> After a long search and lots of trial and error, I managed to get the > following to work reliably for me: > > RewriteEngine on > RewriteCond %{SERVER_PORT} !^443$ > RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [L,R,NC] > to use some configuration you do not understand is never ever recommended and even might be dangerous.
Perhaps I should have been more specific; however, while I don't understand the [L,R] so far I do understand the rest:
1. Turn on the rewrite engine.
2. If the HTTP variable SERVER_PORT is not equal to 443, then:
3. Take any URL that starts with a slash (that is, all URL's supplied) and memorize (.*) everything after the initial slash. Then rewrite the URL as "https://SERVERNAME/$1 where $1 represents the part previously memorized by the (.*).
So any page requested will be redirected to the same URL but with HTTPS instead of HTTP. The NC means "no case" so matches will be case-insensitive.
-- Rodolfo J. Paiz rpaiz@xxxxxxxxxxxxxx http://www.simpaticus.com