web protocol redirection

Discuss server installationa nd configuration issues here

Moderators: macek, egami, gesf

Post Reply
User avatar
gesf
Moderator
Moderator
Posts: 1717
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden
Contact:

Post by gesf » Sun Jul 31, 2005 3:58 pm

Topic moved to Free time.

Yes, you can make it using Apache and mod_rewrite:

Code: Select all

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: Select all

RewriteCond %{HTTPS} !^on$
Just a better proof for the https.

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Post by Alexej Kubarev » Tue Aug 02, 2005 10:25 am

Topic moved to server configuration instead :)

User avatar
gesf
Moderator
Moderator
Posts: 1717
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden
Contact:

Post by gesf » Tue Aug 02, 2005 10:41 am

Thanks Alexei. Also i've moved it to free time :)

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Post by Alexej Kubarev » Tue Aug 02, 2005 10:53 am

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 :)

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests