Need help with .htaccess mod_rewrite

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!

 

 

 

 

Top