LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Automatic Redirects in Apache (http://www.linuxquestions.org/questions/linux-server-73/automatic-redirects-in-apache-535048/)

kaplan71 03-06-2007 08:01 AM

Automatic Redirects in Apache
 
Hi there --

I have set up SquirrelMail on our e-mail server and I would like to have users be automatically redirected to a secure or https page when they type in the URL to get to the initial login page. The apache server is version 2.2.2. What file(s) should I modify to make this happen? Thanks.

Teukka 03-08-2007 07:09 AM

Quote:

Originally Posted by kaplan71
Hi there --

I have set up SquirrelMail on our e-mail server and I would like to have users be automatically redirected to a secure or https page when they type in the URL to get to the initial login page. The apache server is version 2.2.2. What file(s) should I modify to make this happen? Thanks.

Assuming you are using apache? First enable mod_rewrite (how? depends what distribution you use) and then you can do like this

<VirtualHost *:80>
ServerName some.name.fi
Redirect permanent / https://some.name.fi/
RewriteEngine on
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* - [F]
</VirtualHost>


This is basic and simple rewriterule, works fine


All times are GMT -5. The time now is 08:54 PM.