Web Hosting Talk







View Full Version : Need help with .htaccess mod_rewrite


mrzippy
08-23-2004, 09:11 PM
I am trying to do some complicated (I think) rewrite rules using the rewriteEngine for apache.

However, I've been able to get what I need. First, here's the setup.

http://sub.mydomain.com (/home/username/domains/mydomain.com/public_html/sub/)

https://sub.mydomain.com
(/home/username/domains/mydomain.com/private_html/sub/)

So you can see that the "secure" URL actualy gets the files from a completely different web root then insecure URL. This is silly, and I do not wish to maintain two sets of files in two different locations.

What I'm trying to do is use mod_rewrite so that when the user specifies https, it actually gets the files from the "regular" location automatically.

ie: If I specify https://sub.mydomain.com then I want the files to be retrieved from
/home/username/domains/mydomain.com/public_html/sub/ automatically.

Is tihs possible?

Thanks!

nickn
08-23-2004, 09:17 PM
This is actually better done without mod_rewrite.

The virtual host config for the SSL subdomain can be pointed to the same directory as the standard vhost config.

mrzippy
08-23-2004, 09:25 PM
Originally posted by nickn
This is actually better done without mod_rewrite.

The virtual host config for the SSL subdomain can be pointed to the same directory as the standard vhost config. The problem is that this particular host may not be willing to make this happen, which is why I'm trying to figure out how to do it with mod_rewrite. :)

Even a simple link in the file system would suffice, but I don't think this host is going to do that, either.

mod_rewrite is pretty powerful, but I'm getting lost and my eyes are buggy. I figured I'd ask here before being forced to pay my programmer to do it.