Help with rewriterule

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

This is for Apache 2.4 on Centos7. I am migrating from Apache 2.2 on Centos6.

I want to support redirecting all webmail queries to https. for either queries to:

webmail.foo.com or foo.com/webmail

My old rules were:

<VirtualHost *:80>
    ServerName webmail.htt-consult.com
    ServerAlias webmail
    RewriteEngine On
        RewriteCond  %{SERVER_PORT} !^443$
        RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
        ExpiresDefault "access plus 10 years"
        AddOutputFilterByType DEFLATE text/html text/plain text/xml
    php_admin_flag session.cookie_secure "1"
</VirtualHost>

This SEEMED to only work for the webmail virtual host, and not others on this server. When I used this rule set on the new server, it clearly was redirecting all web accesses to https. So I tried to write a more restrictive rule, trying to follow instructions from

http://httpd.apache.org/docs/current/rewrite/intro.html

It would seem the rule:

        RewriteRule ^.*webmail https://%{SERVER_NAME}%{REQUEST_URI} [L,R]

Should work, but the test site I tried:

http://martinmelin.se/rewrite-rule-tester/

Did not show this did the rewrite to https. Also how to direct Webmail.foo.com to https://webmail.foo.com?

Thank you



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx




[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux