Thanks Brian I figured out the issue, here is the solution RewriteEngine On RewriteLogLevel 8 RewriteLog logs/webserver/rewrite_log # RewriteCond %{HTTP_HOST} ^webserver1.* RewriteCond %{HTTPS} off RewriteCond %{REQUEST_URI} (ssl1(.*)|ssl2(.*)) RewriteRule (.*) https://%{SERVER_NAME}%{REQUEST_URI} [R,L] RewriteCond %{HTTP_HOST} ^webserver1.* RewriteCond %{HTTPS} on RewriteCond %{REQUEST_URI} (ssl1(.*)|ssl2(.*)) RewriteRule ^/(ssl1(.*)|ssl2(.*)) https://%{SERVER_NAME}/tomcat%{REQUEST_URI} [P,QSA,L] RewriteCond %{HTTP_HOST} ^webserver1.* RewriteCond %{HTTPS} on RewriteCond %{REQUEST_URI} (nossl1(.*)|nossl2(.*)) RewriteRule (.*) http://%{SERVER_NAME}%{REQUEST_URI} [R,L] RewriteCond %{HTTP_HOST} ^webserver1.* RewriteCond %{HTTPS} off RewriteCond %{REQUEST_URI} (nossl1(.*)|nossl2(.*)) RewriteRule ^/(nossl1(.*)|nossl2(.*)) http://%{SERVER_NAME}/tomcat%{REQUEST_URI} [P,QSA,L] Thanks. Inas. > Date: Wed, 1 Apr 2009 14:15:42 -0400 > From: mearns.b@xxxxxxxxx > To: users@xxxxxxxxxxxxxxxx > Subject: Re: Switching between http and https > > On Wed, Apr 1, 2009 at 1:24 PM, inas inassen <mezghena@xxxxxxxxxxx> wrote: > > Thanks Brian, > > > > you right, I did correction, but it seems not working for ssl and it works > > for nossl > > > > this is my rewrite rules > > > > RewriteEngine On > > RewriteLog logs/webserver1/rewrite_log > > # > > RewriteCond %{HTTP_HOST} ^webserver1.* > > RewriteCond %{HTTPS} =off > > RewriteCond %{SERVER_PORT} ^80 > > RewriteRule ^/nossl(.*) /tomcat/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(.*) /tomcat/ssl$1 [P,QSA,L] > > RewriteRule ^/nossl(.*)$ http://%{SERVER_NAME}:80/nossl$1 [NC,L] > > # > > > > this is my proxy balancer: > > > > <Proxy balancer://tomcat/> > > BalancerMember ajp://appserver:8009 route=r1 loadfactor=1 > > keepalive=On > > </Proxy> > > <Location /tomcat/nossl/> > > ProxyPass balancer://tomcat/sossl/ nofailover=On > > lbmethod=byrequests > > ProxyPassReverse balancer://tomcat/nossl/ > > Order Deny,Allow > > Allow from all > > </Location> > > <Location /tomcat/ssl/> > > ProxyPass balancer://tomcat/ssl/ nofailover=On > > lbmethod=byrequests > > ProxyPassReverse balancer://tomcat/ssl/ > > Order Deny,Allow > > Allow from all > > </Location> > > > > > > Any suggestion? > > > > thanks. > > > > Inas. > > > > Sorry, don't know anything about load-balancers or Tomcat. Only thing > that stands out to me is that you should probably use the [R] flag on > the rewrite rules that specify absolute paths. Otherwise, there's a > good chance Apache is going to make it an interal rewrite and you > can't change protocols using internal rewrites, you need to redirect > the client to tell them to use the different protocol. > > Best, > -Brian > > -- > Feel free to contact me using PGP Encryption: > Key Id: 0x3AA70848 > Available from: http://pgp.mit.edu/ > > --------------------------------------------------------------------- > The official User-To-User support forum of the Apache HTTP Server Project. > See <URL:http://httpd.apache.org/userslist.html> for more info. > To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx > " from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx > For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx > Découvrez toutes les possibilités de communication avec vos proches |