Hi,
I'm new to the forum and mod_rewrite. I was hoping someone could help me out with this problem I can't figure out. First, a little background about the current rewrite rules setup:
The main site's subfolders are rewritten to subdomains as follows:
website.example.com --> www.example.com/website.
The server is a Windows Apache 2.0 with mod_ssl. The Rewrite rules are located in httpd.conf and ssl.conf configuration files. Here is an example rewrite, and how the config files look like:
httpd.conf:
RewriteEngine On
RewriteRule ^/website(.*)$ https://www.example.com/website/ [NC,R,L]
This command redirects any request that contains "website" to SSL. Then the internal rewrite occurs within ssl.conf:
ssl.conf:
RewriteEngine On
RewriteRule ^/website(.*)$ http://website.example.com/website/$1 [NC,P]
ProxyPassReverse /Website/ http://website.example.com/website/
RewriteRule ^/$ http://www.example.com/ [R,L]
SSLEngine on
<Location />
SSLRequire (%{SSL_CIPHER_USEKEYSIZE} >= 128)
</Location>
This works great, except if I have a website that sits at the root web, folders within the subdomain are not rewritten. For example, instead of
www.example.com/website/Login.asp
I get
www.example.com/Login.asp
which of course leads to invalid pages. I am suspecting that there are relative paths on the site itself preventing it from staying nested under the subfolder. Is there a workaround for this? Using this strategy we have only been able to publish sites that are nested under subwebs. Is there a better way to go about it?
Many thanks,
Nick