LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-22-2006, 08:08 AM   #1
cccc
Senior Member
 
Registered: Sep 2003
Distribution: Debian Squeeze / Wheezy
Posts: 1,623

Rep: Reputation: 51
redirect SquirrelMail from http to https using Apache2


hi

howto redirect SquirrelMail login page from http to https using Apache2 ?

I've tried to add the following entry:
Code:
# cat /etc/apache2/sites-enabled/000-default

Alias /mail /usr/share/squirrelmail

<Directory /usr/share/squirrelmail>
        php_flag register_globals off
        Options Indexes FollowSymLinks
        <IfModule mod_dir.c>
        DirectoryIndex index.php
</IfModule>

# access to configtest is limited by default to prevent information leak
        <Files configtest.php>
        order deny,allow
        deny from all
        allow from 127.0.0.1
        </Files>
</Directory>

<IfModule mod_rewrite.c>
  <IfModule mod_ssl.c>
    <Location /mail>
      RewriteEngine on
      RewriteCond %{HTTPS} !^on$ [NC]
      RewriteRule . https://mydomain.net/mail  [L]
    </Location>
  </IfModule>
</IfModule>
but it doesn't work.

Last edited by cccc; 09-22-2006 at 08:16 AM.
 
Old 09-22-2006, 11:22 AM   #2
mpapet
Member
 
Registered: Nov 2003
Location: Los Angeles
Distribution: debian
Posts: 548

Rep: Reputation: 72
new https site

Quote:
Originally Posted by cccc
hi

howto redirect SquirrelMail login page from http to https using Apache2 ?

I've tried to add the following entry:
Code:
# cat /etc/apache2/sites-enabled/000-default

Alias /mail /usr/share/squirrelmail

<Directory /usr/share/squirrelmail>
        php_flag register_globals off
        Options Indexes FollowSymLinks
        <IfModule mod_dir.c>
        DirectoryIndex index.php
</IfModule>

# access to configtest is limited by default to prevent information leak
        <Files configtest.php>
        order deny,allow
        deny from all
        allow from 127.0.0.1
        </Files>
</Directory>

<IfModule mod_rewrite.c>
  <IfModule mod_ssl.c>
    <Location /mail>
      RewriteEngine on
      RewriteCond %{HTTPS} !^on$ [NC]
      RewriteRule . https://mydomain.net/mail  [L]
    </Location>
  </IfModule>
</IfModule>
but it doesn't work.
It's not clear if you created a second apache ssl instance and then put squirrelmail files under that instance. (sites_enabled I believe is what they call it)

Please provide some more information.
 
Old 09-22-2006, 10:26 PM   #3
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 270Reputation: 270Reputation: 270
If you just want to redirect any traffic from http to the https so it's secure, don't mess with rewrite conditions as that is the wrong approach, just use RedirectMatch for the virtual host or in the configuration..

Code:
RedirectMatch ^/$ https://www.mydomain.net/mail
 
Old 09-23-2006, 10:02 AM   #4
cccc
Senior Member
 
Registered: Sep 2003
Distribution: Debian Squeeze / Wheezy
Posts: 1,623

Original Poster
Rep: Reputation: 51
Code:
# a2enmod rewrite
Module rewrite installed; run /etc/init.d/apache2 force-reload to enable.
and:
Code:
<IfModule mod_rewrite.c>
<IfModule mod_ssl.c>
<Location /mail>
RewriteEngine on
RewriteCond %{HTTPS} !^on$ [NC]
RewriteRule . https://mydomain.net/mail [L]
</Location>
</IfModule>
</IfModule>
in /etc/apache2/sites-enabled/000-default solved my problem.

greetings
cccc
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
http and https wennie Linux - Software 1 04-01-2005 11:47 AM
Apache2, SSL, HTTPS... KneeLess Debian 3 09-02-2004 09:44 PM
Apache & Squirrelmail:Redirect to https? mac_phil Linux - Software 1 05-24-2004 03:52 AM
HTTP to HTTPS shegde Linux - Software 8 01-31-2003 04:29 AM
https or http? antken Programming 3 10-30-2002 05:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration