Post by SwiftyPost by BootNicRewriteCond %{REQUEST_URI} ^/~ [NC]
### test for HTTPS if you DON'T have separate configuration for SSL
### RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
Thank you for that, which I'll try on my next working day.
I don't understand what is meant by having a separate configuration
for SSL.
The standard installation (Apache 2.2) encourages putting your SSL
definitions in sites-enabled/default-ssl but that is little more than
an administrative convenience, so this is probably not what is meant.
If you are going to add this RewriteRule to a virtualhost under
sites-enabled/default-ssl, and DON'T test for HTTPS, it will be and endless
redirect. DO test for HTTPS, it will never redirect anything. It would be
useless to add this RewriteRule to a virtualhost under
sites-enabled/default-ssl.
If you are going to add this RewriteRule to a virtualhost under
sites-enabled/default, there should be no reason to test for HTTPS
If you were to use .htaccess for both SSL and non SSL and add this RewriteRule
to .htaccess then test for HTTPS.
AccessFileName .htaccessSSL could be added to the virtualhost under
sites-enabled/default-ssl.
if .htaccess is used for non SSL and .htaccessSSL for SSL, then this
RewriteRule could be added to .htaccess and no need to test for HTTPS.
It would be just as useless to add this RewriteRule to .htaccessSSl for the
same reasons as adding it to a virtualhost under sites-enabled/default-ssl.
Presuming AllowOverride is set to allow this, good for testing, no
need to restart apache for every change, then move to main server configuration.
[snip]
--
BootNic Sun Apr 29, 2012 11:09 am
Wife who put husband in doghouse soon find him in cat house.
*Ancient Chinese Proverbs*