rewriting http --> https not working

Todd Wease wease1 at coldbrains.com
Wed Jul 27 00:16:18 UTC 2005


On Tue, 2005-07-26 at 13:26 -0400, Matt Morgan wrote:
> I thought I understood how to use apache's rewriting rules to force
> certain pages to https, but it's not working. I've compared my .conf
> file to others online, and it looks right to me.
> 
> This is my /etc/httpd/conf.d/force-ssl.conf file:
> -------
> # Rewrite Rules.
> RewriteEngine On
> RewriteCond %{HTTPS} !=on
> RewriteRule ^/webmail/(.*) https://%{SERVER_NAME}/webmail/$1 [R,L]
> RewriteRule ^/mailman/(.*) https://%{SERVER_NAME}/mailman/$1 [R,L]
> 
> #Debug rewrite rules
> RewriteLog /etc/httpd/logs/rewrite_engine_log
> RewriteLogLevel 3
> -------
> The idea is to take any URL under /webmail or /mailman and redirect it
> to https, so that, for example,
> 
> http://www.concretecomputing.com/webmail/
> 
> gets redirected to the same page, but using https. It doesn't happen.
> 
> SSL is working; if I type in the https it works fine. But no
> redirection is happening. I have restarted Apache uneventfully. What
> did I do wrong?
> 
> Thanks,
> Matt
> 

This is how I wrote mine for squirrelmail:

RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/webmail(.*)$ https://%{SERVER_NAME}/webmail$1

Todd





More information about the fedora-list mailing list