web protocol redirection

gesf

New member
Topic moved to Free time.

Yes, you can make it using Apache and mod_rewrite:
Code:
RewriteEngine on
RewriteBase   /usr/local/website
RewriteCond   %{SERVER_PORT}  !^443$
RewriteRule   ^(.*)?$   https://%{SERVER_NAME}/$1 [L,R]
With this code any http (80) request to the server will be forwarded to https (443).

Another alternative for the 3rd line could be:
Code:
RewriteCond %{HTTPS} !^on$
Just a better proof for the https.
 
i saw that: but its place is in Server configuration. but it was locked by the time of posting. now i repened the forum and therefore moved it here :)
 
Back
Top