I have this working. Here is my rewrite section:
############################# # Mod rewrite stuff #############################
# rewrite environment RewriteEngine on RewriteLog /var/log/httpd/https_rewrite_log RewriteLogLevel 1
# redirect http to https # If you don't try to access https, then redirect to https RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [L,R]
This is very close to yours. The big difference is that I have it in a VirtualHost block (server config) and you have it in a directory block. The two are handled differently by mod_rewrite; since you are really trying to do a server (virtual or real) redirect, why not move it out of the directory block?
IT WORKS!
I can do no less than to bow down before you, and buy you virtual beer. And if you're ever in Guatemala, I'll make it real beer (or anything else you care to drink).
The syntax is pretty damn close to what I had, but I changed the main server configuration to default settings again (in effect, not using the main server block) and put this into a VirtualHost and... BAM! right through the first time. For the record, this is my VirtualHost block:
<VirtualHost *> ServerName apollo.paiz.org ServerAdmin [EMAIL PROTECTED] DocumentRoot /var/www/apollo.paiz.org
RewriteEngine on RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [L,R,NC] </VirtualHost>
Any page requested, any page at all, is instantly and transparently rewritten to use HTTPS. Beautiful. Just... beautiful.
-- Rodolfo J. Paiz [EMAIL PROTECTED]
-- redhat-list mailing list unsubscribe mailto:[EMAIL PROTECTED] https://www.redhat.com/mailman/listinfo/redhat-list