web protocol redirection

Discuss server installationa nd configuration issues here

Moderators: egami, macek, gesf

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

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.
Sincerely,
Gonçalo "gesf" Fontoura

gesf.org | sessionstart.com | urlms.com

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

Tue Aug 02, 2005 10:25 am

Topic moved to server configuration instead :)
Best Regards,
Alexej Kubarev
-------------------------------
Zend Certified Engineer
Image Image

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

Tue Aug 02, 2005 10:41 am

Thanks Alexei. Also i've moved it to free time :)
Sincerely,
Gonçalo "gesf" Fontoura

gesf.org | sessionstart.com | urlms.com

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

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 :)
Best Regards,
Alexej Kubarev
-------------------------------
Zend Certified Engineer
Image Image

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest