Switching between http and https

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

 



Hi all,
 
I'm using mod_proxy balancer with tomcat and apache.
I used mod_rewrite to switch between http and https
 
When I have the pattern /nossl ==> I want to redirect to http
When I have the pattern /ssl   ==> I want to redirect to https
 
so I write the following rules:
 
RewriteEngine On
RewriteLog logs/webserver1/rewrite_log
#
RewriteCond %{HTTP_HOST} ^webserver1.*
RewriteCond %{HTTP} =on
RewriteCond %{SERVER_PORT} ^80
RewriteRule ^/nossl(.*)    /balancer/nossl$1 [P,QSA,L]
RewriteRule ^/ssl(.*)$     https://%{SERVER_NAME}:443/ssl$1 [NC,L]
#
#
RewriteCond %{HTTP_HOST} ^webserver1.*
RewriteCond %{HTTPS} =on
RewriteCond %{SERVER_PORT} ^443
RewriteRule ^/ssl(.*)      /balancer/ssl$1 [P,QSA,L]
RewriteRule ^/nossl(.*)$   http://%{SERVER_NAME}:80/nossl$1 [NC,L]
#
Is there something wrong, because it doesn't work
 
thanks for help.
Inas.


Découvrez tout ce que Windows Live a à vous apporter !

[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