logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: URL Rewrite
Author
Greg Howey



Joined: 07 Feb 2008
Posts: 4

PostPosted: Thu 07 Feb '08 19:44    Post subject: URL Rewrite Reply with quote

I have Apache 2.2.8 HTTP server sucessfully running on Windows XP Pro. I with a SSL virtual directory for secure access of my web mail. I can access this virtual directoy by the URL https://my.domain.com/folder and https:/my.domain.com. This is not the desired effect I would like. I would like to be able to access this virtual directory using only https:/my.domain.com/folder. Can any one explain to me how to accomplish this goal. Thanks in advance.
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Thu 07 Feb '08 23:00    Post subject: Reply with quote

More info needed.

DocumentRoot for www.mydomain.com

is /folder an aliased folder? is it pointing to the same location on the hard drive as the DocRoot for www.mydomain.com (which is assumed since they both land you in the same place)
Back to top
Greg Howey



Joined: 07 Feb 2008
Posts: 4

PostPosted: Fri 08 Feb '08 6:46    Post subject: More Information Reply with quote

Sorry, I guess I was a little vague. Here is the document root for www.mydomain.com in httpd.conf

<Directory "C:/Program Files/Apache Software Foundation/Apache2.2/mydomain.com">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>

Here is the alias section for the virtual ssl folder in httpd.conf

<IfModule alias_module>
Alias /webmail/ "C:/Program Files/Apache Software Foundation/Apache2.2/folder/"
Alias /webmail "C:/Program Files/Apache Software Foundation/Apache2.2/folder"
ScriptAlias /cgi-bin/ "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/"
</IfModule>

And here is the virtual host in httpd-ssl

<VirtualHost _default_:443>
DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/folder"
ServerName www.mydomain.com/folder:443
ServerAdmin webmaster@mydomain.com

I would like access to be only by the URL https:/www.mydomain.com/folder and not https:/www.mydomain.com. As it is right now both URL's will take you to the secure virtual folder. Thanks, Greg.
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Sun 10 Feb '08 7:25    Post subject: Reply with quote

As I said, If DocRoot is pointing to the folder it is going to end up there from https://www.mydomain.com

So

<VirtualHost _default_:443>
DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/mydomain.com"
Alias /folder "C:/Program Files/Apache Software Foundation/Apache2.2/folder"
ServerName www.mydomain.com:443
ServerAdmin webmaster@mydomain.com
DirectoryIndex folder/index.html
..
</VirtualHost>

What will happen is when they go to https://www.mydomain.com it will just nudge them to https://www.mydomain.com/folder/index.html

It's not a true rewrite but works. Sorry for the delay, I started to answer 2 times prior and got shanghai'd by life both times.
Back to top
Greg Howey



Joined: 07 Feb 2008
Posts: 4

PostPosted: Sun 10 Feb '08 15:38    Post subject: Reply with quote

Thanks for the response, believe me, I understand about life. I have followed your recommendations to the "T" and still have the same results as previously stated. It would appear that the Alias section under the virtual directory is not redirecting to the desired "folder". I have copied the pertinent part of my virtual directory below, if you would look it over I would appreciate it. Thanks, Greg.


<VirtualHost _default_:443>
DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/domain.com"
<IfModule alias_module>
Alias /folder "C:/Program Files/Apache Software Foundation/Apache2.2/folder"
</IfModule>
ServerName www.mydomain.com:443
ServerAdmin webmaster@domain.com
<IfModule dir_module>
DirectoryIndex index.htm
</IfModule
Back to top
Greg Howey



Joined: 07 Feb 2008
Posts: 4

PostPosted: Sun 10 Feb '08 16:18    Post subject: Reply with quote

Thanks for your help, although it didn't entirely resolve my problem, you did point me in the right directions. I took your recommendation and did a little more research and found a solution. Again, I have pasted the pertinent part of my virtual configuration file below in hope that it will help someone else. If I understand correctly any https request to mydomain.com will be sent to "folder" by the RedirectMatch directive. Thanks again, Greg.




<VirtualHost _default_:443>
DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/website"
RedirectMatch ^/$ /folder/
ServerName www.mydomain.com:443
ServerAdmin webmaster@mydomain.com
<IfModule dir_module>
DirectoryIndex index.htm
</IfModule>
Back to top


Reply to topic   Topic: URL Rewrite View previous topic :: View next topic
Post new topic   Forum Index -> Apache