htaccess How To Allow Both HTTP and HTTPS Even with Proxies?
Posted: Sun Jun 28, 2009 8:36 am
Let's say you've done the ground work on a couple of your hosting plans such that you can access your domains via http or https.
Now let's say you introduce Proxy Throughput (the [P] operator) so that certain subdomains can get routed to other servers, like so:
RewriteCond %{HTTP_HOST} =ricks-motorcycles.mysite.com
RewriteRule ^(.*)$ http://alpha2.com/ricks-motorcycles/$1 [P,L]
Where, if you have alpha1.com and alpha2.com, and mysite.com is parked at alpha1.com and this entry is in the .htaccess file, the guys at Rick's Motorcycles can access their site off of alpha2.com as if they were on mysite.com.
Okay, fine, but now how to get the https working and with the least amount of htaccess lines possible? This is important as far as line count because let's say I may have 500 or more entries like this in that file for users who sign up on my website.
Now let's say you introduce Proxy Throughput (the [P] operator) so that certain subdomains can get routed to other servers, like so:
RewriteCond %{HTTP_HOST} =ricks-motorcycles.mysite.com
RewriteRule ^(.*)$ http://alpha2.com/ricks-motorcycles/$1 [P,L]
Where, if you have alpha1.com and alpha2.com, and mysite.com is parked at alpha1.com and this entry is in the .htaccess file, the guys at Rick's Motorcycles can access their site off of alpha2.com as if they were on mysite.com.
Okay, fine, but now how to get the https working and with the least amount of htaccess lines possible? This is important as far as line count because let's say I may have 500 or more entries like this in that file for users who sign up on my website.