You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Ian Stradling <Ia...@impalanetworks.com> on 2011/02/28 20:40:14 UTC

[users@httpd] re: Rewrite Conditions & Rules

Hi Folks,

I'm new to the manual side of web administration, and am using Apache2 in a Debian Linux distribution.

I was asked by my boss to set up a situation where we force SSL on certain portions of a website, and turn it off when the viewer goes to another page on the site. I have decided to use mod_rewrite to do so.  I've read through and have come up with the below code.  

This set of code is on the base port 80 site.  I have created this code with the intent to rewrite the URL to SSL if the page is not the string.  

	RewriteCond %{REQUEST_URI} !^/
	RewriteCond %{REQUEST_URI} !^/home   
	RewriteCond %{REQUEST_URI} !^/insurance-tips 
	RewriteCond %{REQUEST_URI} !^/add-a-tip  
	RewriteCond %{HTTPS} !=on  
	RewriteRule .* https://www.website.com/$1 [R,L]


This set of code, I have written on the 443 SSL site.  

	RewriteCond %{REQUEST_URI} ^/home
	RewriteCond %{REQUEST_URI} ^/insurance-tips
	RewriteCond %{REQUEST_URI} ^/add-a-tip
	RewriteCond %{HTTPS} =on
	RewriteRule ^/(.*) http://www.website.com/$1 [R,L]

When you first go to the site, it behaves as I want it to and leaves everything as HTTP.  But when you go back to the home page, it is supposed to remove the HTTPS, but it does not.  I'm hoping that someone can critique my code here and tell me where I've gone wrong.  I appreciate any feedback.


Thanks!

Ian Stradling



---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Rewrite Conditions & Rules

Posted by Ian Stradling <Ia...@impalanetworks.com>.
Ok, so the rule sets are now working somewhat.  

On the HTTP(80) side, I have the following:

        RewriteCond %{REQUEST_URI} !^/$
        RewriteCond %{REQUEST_URI} !^/home   
        RewriteCond %{REQUEST_URI} !^/insurance-tips/$
        RewriteCond %{REQUEST_URI} !^/add-a-tip  
        RewriteCond %{HTTPS}       off  
        RewriteRule / https://www.woodsins.com%{REQUEST_URI} [R,L]

These set of rules & conditions seem to be working as intended.  

On the HTTPS(443) side, I have the following:

        RewriteCond %{REQUEST_URI} ^/$
        RewriteCond %{HTTPS}       on
        RewriteRule / http://www.woodsins.com%{REQUEST_URI} [R,L]

        RewriteCond %{REQUEST_URI} ^/home
        RewriteCond %{HTTPS}       on
        RewriteRule / http://www.woodsins.com%{REQUEST_URI} [R,L]

        RewriteCond %{REQUEST_URI} ^/insurance-tips/$
        RewriteCond %{HTTPS}       on
        RewriteRule / http://www.woodsins.com%{REQUEST_URI} [R,L]

        RewriteCond %{REQUEST_URI} ^/add-a-tip/$
        RewriteCond %{HTTPS}       on
        RewriteRule / http://www.woodsins.com%{REQUEST_URI} [R,L]

        RewriteCond %{REQUEST_URI} ^/index.php/$
        RewriteCond %{HTTPS}       on
        RewriteRule / http://www.woodsins.com%{REQUEST_URI} [R,L]

Only some of these rules appear to be working properly, in particular the ^/$ and the ^/index.php/$ (which I added myself).  

Please correct me if I'm wrong, but it feels like maybe I'm just throwing myself into a loopback that just ends up forcing SSL on everything but the index.php portion.  As a side note, I had to add the /$ to the ^/insurance-tips because when it's not there, that particular page becomes disabled. 

Again, thanks for the assistance with this issue.



-----Original Message-----
From: Eugene [mailto:eugene.lysenko@gmail.com] 
Sent: Thursday, March 03, 2011 10:55 AM
To: users@httpd.apache.org
Subject: RE: [users@httpd] Rewrite Conditions & Rules

My mistake. Bottom part must be like this:

        RewriteCond %{REQUEST_URI} ^/$
        RewriteCond %{HTTPS}       on
        RewriteRule / http://www.website.com%{REQUEST_URI} [R,L]

        RewriteCond %{REQUEST_URI} ^/home
        RewriteCond %{HTTPS}       on
        RewriteRule / http://www.website.com%{REQUEST_URI} [R,L]

        RewriteCond %{REQUEST_URI} ^/insurance-tips
        RewriteCond %{HTTPS}       on
        RewriteRule / http://www.website.com%{REQUEST_URI} [R,L]

        RewriteCond %{REQUEST_URI} ^/add-a-tip
        RewriteCond %{HTTPS}       on
        RewriteRule / http://www.website.com%{REQUEST_URI} [R,L]


-----Original Message-----
From: Ian Stradling <Ia...@impalanetworks.com>
Reply-to: "users@httpd.apache.org" <us...@httpd.apache.org>
To: users@httpd.apache.org <us...@httpd.apache.org>
Subject: RE: [users@httpd] Rewrite Conditions & Rules
Date: Thu, 3 Mar 2011 17:39:33 +0000

No, unfortunately it doesn’t.  When a visitor first goes to the website, it stays in HTTP.  As soon as a visitor clicks on one of the HTTPS links, the rewrite rules will force HTTPS for the rest of the time that the visitor is on the site regardless of the links they click on.  

I need the Rewrite rules to be able to take it out of HTTPS when they click on a portion of the site that isn't HTTPS. The code all looks like it should work, but there's something strange going on with it.  It looks like the second set of code isn't firing.



-----Original Message-----
From: Eugene [mailto:eugene.lysenko@gmail.com] 
Sent: Thursday, March 03, 2011 9:33 AM
To: users@httpd.apache.org
Subject: RE: [users@httpd] Rewrite Conditions & Rules

Doesn't it fit your needs?

        RewriteCond %{REQUEST_URI} !^/$
        RewriteCond %{REQUEST_URI} !^/home   
        RewriteCond %{REQUEST_URI} !^/insurance-tips 
        RewriteCond %{REQUEST_URI} !^/add-a-tip  
        RewriteCond %{HTTPS}       off  
        RewriteRule / https://www.website.com%{REQUEST_URI} [R,L]

        RewriteCond %{REQUEST_URI} ^/$
        RewriteCond %{REQUEST_URI} ^/home
        RewriteCond %{REQUEST_URI} ^/insurance-tips
        RewriteCond %{REQUEST_URI} ^/add-a-tip
        RewriteCond %{HTTPS}       on
        RewriteRule / http://www.website.com%{REQUEST_URI} [R,L]


-----Original Message-----
From: Ian Stradling <Ia...@impalanetworks.com>
Reply-to: "users@httpd.apache.org" <us...@httpd.apache.org>
To: users@httpd.apache.org <us...@httpd.apache.org>
Subject: RE: [users@httpd] Rewrite Conditions & Rules
Date: Thu, 3 Mar 2011 16:05:54 +0000

Has anyone ever used mod_rewrite to try and force SSL on certain portions of a website?  

I feel like I'm running around in circles trying to figure it out.  As a point of reiteration, I'm using the following code:

	RewriteCond %{REQUEST_URI} !^/
	RewriteCond %{REQUEST_URI} !^/home   
	RewriteCond %{REQUEST_URI} !^/insurance-tips 
	RewriteCond %{REQUEST_URI} !^/add-a-tip  
	RewriteCond %{HTTPS} !=on  
	RewriteRule .* https://www.website.com/$1 [R,L]

I've tried implementing a couple of these but it never really does what I think it's supposed to do.  If someone could please point me in the right direction, I'd appreciate it.

Thanks!

-----Original Message-----
From: Ian Stradling [mailto:Ian@impalanetworks.com] 
Sent: Monday, February 28, 2011 12:40 PM
To: users@httpd.apache.org
Subject: [users@httpd] re: Rewrite Conditions & Rules

Hi Folks,

I'm new to the manual side of web administration, and am using Apache2 in a Debian Linux distribution.

I was asked by my boss to set up a situation where we force SSL on certain portions of a website, and turn it off when the viewer goes to another page on the site. I have decided to use mod_rewrite to do so.  I've read through and have come up with the below code.  

This set of code is on the base port 80 site.  I have created this code with the intent to rewrite the URL to SSL if the page is not the string.  

	RewriteCond %{REQUEST_URI} !^/
	RewriteCond %{REQUEST_URI} !^/home   
	RewriteCond %{REQUEST_URI} !^/insurance-tips 
	RewriteCond %{REQUEST_URI} !^/add-a-tip  
	RewriteCond %{HTTPS} !=on  
	RewriteRule .* https://www.website.com/$1 [R,L]


This set of code, I have written on the 443 SSL site.  

	RewriteCond %{REQUEST_URI} ^/home
	RewriteCond %{REQUEST_URI} ^/insurance-tips
	RewriteCond %{REQUEST_URI} ^/add-a-tip
	RewriteCond %{HTTPS} =on
	RewriteRule ^/(.*) http://www.website.com/$1 [R,L]

When you first go to the site, it behaves as I want it to and leaves everything as HTTP.  But when you go back to the home page, it is supposed to remove the HTTPS, but it does not.  I'm hoping that someone can critique my code here and tell me where I've gone wrong.  I appreciate any feedback.


Thanks!

Ian Stradling




---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org




---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Rewrite Conditions & Rules

Posted by Martin Barry <ma...@supine.com>.
Hi Ian

$quoted_author = "Ian Stradling" ;
> 
> Here is what I've gleaned from the log I started.  FYI, I clicked on a
> link within the website that is supposed to go to ../insurance-tips/
> Anything related to /insurance-tips, /add-a-tip, /home, and / are supposed
> to NOT be HTTPS...yet, whenever I click on the 'insurance-tips' link, it
> comes up as HTTPS.

Your patterns both specify 

        ^/insurance-tips/$ 

while this request has REQUEST_URI of

        /insurance-tips/40/54-front-end-capabilities

which clearly doesn't match and hence the redirect is from HTTP to HTTPS.


If you want everything in that directory to be HTTP only then I think the
regex you need to use is

        ^/insurance-tips

in both sections.


You could also reduce the verbosity of your second section by using [OR] on
the RewriteCond lines with a single RewriteRule.

cheers
Marty

---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Rewrite Conditions & Rules

Posted by Ian Stradling <Ia...@impalanetworks.com>.
Here is what I've gleaned from the log I started.  FYI, I clicked on a link within the website that is supposed to go to ../insurance-tips/   Anything related to /insurance-tips, /add-a-tip, /home, and / are supposed to NOT be HTTPS...yet, whenever I click on the 'insurance-tips' link, it comes up as HTTPS.


69.39.19.253 - - [03/Mar/2011:14:43:10 --0700] [www.woodsins.com/sid#819b968][rid#85260c8/initial] (2) init rewrite engine with requested uri /insurance-tips/40/54-front-end-capabilities
69.39.19.253 - - [03/Mar/2011:14:43:10 --0700] [www.woodsins.com/sid#819b968][rid#85260c8/initial] (3) applying pattern '^(.*)' to uri '/insurance-tips/40/54-front-end-capabilities'
69.39.19.253 - - [03/Mar/2011:14:43:10 --0700] [www.woodsins.com/sid#819b968][rid#85260c8/initial] (4) RewriteCond: input='www.woodsins.com' pattern='=webmail.woodsins.com' => not-matched
69.39.19.253 - - [03/Mar/2011:14:43:10 --0700] [www.woodsins.com/sid#819b968][rid#85260c8/initial] (3) applying pattern '^(.*)' to uri '/insurance-tips/40/54-front-end-capabilities'
69.39.19.253 - - [03/Mar/2011:14:43:10 --0700] [www.woodsins.com/sid#819b968][rid#85260c8/initial] (4) RewriteCond: input='www.woodsins.com' pattern='=admin.woodsins.com' => not-matched
69.39.19.253 - - [03/Mar/2011:14:43:10 --0700] [www.woodsins.com/sid#819b968][rid#85260c8/initial] (3) applying pattern '/' to uri '/insurance-tips/40/54-front-end-capabilities'
69.39.19.253 - - [03/Mar/2011:14:43:10 --0700] [www.woodsins.com/sid#819b968][rid#85260c8/initial] (4) RewriteCond: input='/insurance-tips/40/54-front-end-capabilities' pattern='^/$' => not-matched
69.39.19.253 - - [03/Mar/2011:14:43:10 --0700] [www.woodsins.com/sid#819b968][rid#85260c8/initial] (3) applying pattern '/' to uri '/insurance-tips/40/54-front-end-capabilities'
69.39.19.253 - - [03/Mar/2011:14:43:10 --0700] [www.woodsins.com/sid#819b968][rid#85260c8/initial] (4) RewriteCond: input='/insurance-tips/40/54-front-end-capabilities' pattern='^/home' => not-matched
69.39.19.253 - - [03/Mar/2011:14:43:10 --0700] [www.woodsins.com/sid#819b968][rid#85260c8/initial] (3) applying pattern '/' to uri '/insurance-tips/40/54-front-end-capabilities'
69.39.19.253 - - [03/Mar/2011:14:43:10 --0700] [www.woodsins.com/sid#819b968][rid#85260c8/initial] (4) RewriteCond: input='/insurance-tips/40/54-front-end-capabilities' pattern='^/insurance-tips/$' => not-matched
69.39.19.253 - - [03/Mar/2011:14:43:10 --0700] [www.woodsins.com/sid#819b968][rid#85260c8/initial] (3) applying pattern '/' to uri '/insurance-tips/40/54-front-end-capabilities'
69.39.19.253 - - [03/Mar/2011:14:43:10 --0700] [www.woodsins.com/sid#819b968][rid#85260c8/initial] (4) RewriteCond: input='/insurance-tips/40/54-front-end-capabilities' pattern='^/add-a-tip/$' => not-matched
69.39.19.253 - - [03/Mar/2011:14:43:10 --0700] [www.woodsins.com/sid#819b968][rid#85260c8/initial] (3) applying pattern '/' to uri '/insurance-tips/40/54-front-end-capabilities'
69.39.19.253 - - [03/Mar/2011:14:43:10 --0700] [www.woodsins.com/sid#819b968][rid#85260c8/initial] (4) RewriteCond: input='/insurance-tips/40/54-front-end-capabilities' pattern='^/index.php/$' => not-matched
69.39.19.253 - - [03/Mar/2011:14:43:10 --0700] [www.woodsins.com/sid#819b968][rid#85260c8/initial] (1) pass through /insurance-tips/40/54-front-end-capabilities
69.39.19.253 - - [03/Mar/2011:14:43:10 --0700] [www.woodsins.com/sid#819b968][rid#85260c8/initial] (3) [perdir/home/woodsins/public_html/] add path info postfix: /home/woodsins/public_html/insurance-tips -> /home/woodsins
/public_html/insurance-tips/40/54-front-end-capabilities
69.39.19.253 - - [03/Mar/2011:14:43:10 --0700] [www.woodsins.com/sid#819b968][rid#85260c8/initial] (3) [perdir
/home/woodsins/public_html/] strip per-dir prefix: /home/woodsins/public_html/insurance-tips/40/54-front-end-capabilities -> insurance-tips/40/54-front-end-capabilities


-----Original Message-----
From: Eugene [mailto:eugene.lysenko@gmail.com] 
Sent: Thursday, March 03, 2011 10:55 AM
To: users@httpd.apache.org
Subject: RE: [users@httpd] Rewrite Conditions & Rules

My mistake. Bottom part must be like this:

        RewriteCond %{REQUEST_URI} ^/$
        RewriteCond %{HTTPS}       on
        RewriteRule / http://www.website.com%{REQUEST_URI} [R,L]

        RewriteCond %{REQUEST_URI} ^/home
        RewriteCond %{HTTPS}       on
        RewriteRule / http://www.website.com%{REQUEST_URI} [R,L]

        RewriteCond %{REQUEST_URI} ^/insurance-tips
        RewriteCond %{HTTPS}       on
        RewriteRule / http://www.website.com%{REQUEST_URI} [R,L]

        RewriteCond %{REQUEST_URI} ^/add-a-tip
        RewriteCond %{HTTPS}       on
        RewriteRule / http://www.website.com%{REQUEST_URI} [R,L]


-----Original Message-----
From: Ian Stradling <Ia...@impalanetworks.com>
Reply-to: "users@httpd.apache.org" <us...@httpd.apache.org>
To: users@httpd.apache.org <us...@httpd.apache.org>
Subject: RE: [users@httpd] Rewrite Conditions & Rules
Date: Thu, 3 Mar 2011 17:39:33 +0000

No, unfortunately it doesn’t.  When a visitor first goes to the website, it stays in HTTP.  As soon as a visitor clicks on one of the HTTPS links, the rewrite rules will force HTTPS for the rest of the time that the visitor is on the site regardless of the links they click on.  

I need the Rewrite rules to be able to take it out of HTTPS when they click on a portion of the site that isn't HTTPS. The code all looks like it should work, but there's something strange going on with it.  It looks like the second set of code isn't firing.



-----Original Message-----
From: Eugene [mailto:eugene.lysenko@gmail.com] 
Sent: Thursday, March 03, 2011 9:33 AM
To: users@httpd.apache.org
Subject: RE: [users@httpd] Rewrite Conditions & Rules

Doesn't it fit your needs?

        RewriteCond %{REQUEST_URI} !^/$
        RewriteCond %{REQUEST_URI} !^/home   
        RewriteCond %{REQUEST_URI} !^/insurance-tips 
        RewriteCond %{REQUEST_URI} !^/add-a-tip  
        RewriteCond %{HTTPS}       off  
        RewriteRule / https://www.website.com%{REQUEST_URI} [R,L]

        RewriteCond %{REQUEST_URI} ^/$
        RewriteCond %{REQUEST_URI} ^/home
        RewriteCond %{REQUEST_URI} ^/insurance-tips
        RewriteCond %{REQUEST_URI} ^/add-a-tip
        RewriteCond %{HTTPS}       on
        RewriteRule / http://www.website.com%{REQUEST_URI} [R,L]


-----Original Message-----
From: Ian Stradling <Ia...@impalanetworks.com>
Reply-to: "users@httpd.apache.org" <us...@httpd.apache.org>
To: users@httpd.apache.org <us...@httpd.apache.org>
Subject: RE: [users@httpd] Rewrite Conditions & Rules
Date: Thu, 3 Mar 2011 16:05:54 +0000

Has anyone ever used mod_rewrite to try and force SSL on certain portions of a website?  

I feel like I'm running around in circles trying to figure it out.  As a point of reiteration, I'm using the following code:

	RewriteCond %{REQUEST_URI} !^/
	RewriteCond %{REQUEST_URI} !^/home   
	RewriteCond %{REQUEST_URI} !^/insurance-tips 
	RewriteCond %{REQUEST_URI} !^/add-a-tip  
	RewriteCond %{HTTPS} !=on  
	RewriteRule .* https://www.website.com/$1 [R,L]

I've tried implementing a couple of these but it never really does what I think it's supposed to do.  If someone could please point me in the right direction, I'd appreciate it.

Thanks!

-----Original Message-----
From: Ian Stradling [mailto:Ian@impalanetworks.com] 
Sent: Monday, February 28, 2011 12:40 PM
To: users@httpd.apache.org
Subject: [users@httpd] re: Rewrite Conditions & Rules

Hi Folks,

I'm new to the manual side of web administration, and am using Apache2 in a Debian Linux distribution.

I was asked by my boss to set up a situation where we force SSL on certain portions of a website, and turn it off when the viewer goes to another page on the site. I have decided to use mod_rewrite to do so.  I've read through and have come up with the below code.  

This set of code is on the base port 80 site.  I have created this code with the intent to rewrite the URL to SSL if the page is not the string.  

	RewriteCond %{REQUEST_URI} !^/
	RewriteCond %{REQUEST_URI} !^/home   
	RewriteCond %{REQUEST_URI} !^/insurance-tips 
	RewriteCond %{REQUEST_URI} !^/add-a-tip  
	RewriteCond %{HTTPS} !=on  
	RewriteRule .* https://www.website.com/$1 [R,L]


This set of code, I have written on the 443 SSL site.  

	RewriteCond %{REQUEST_URI} ^/home
	RewriteCond %{REQUEST_URI} ^/insurance-tips
	RewriteCond %{REQUEST_URI} ^/add-a-tip
	RewriteCond %{HTTPS} =on
	RewriteRule ^/(.*) http://www.website.com/$1 [R,L]

When you first go to the site, it behaves as I want it to and leaves everything as HTTP.  But when you go back to the home page, it is supposed to remove the HTTPS, but it does not.  I'm hoping that someone can critique my code here and tell me where I've gone wrong.  I appreciate any feedback.


Thanks!

Ian Stradling




---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org




---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Rewrite Conditions & Rules

Posted by Ian Stradling <Ia...@impalanetworks.com>.
The code works exactly as intended.  Many thanks for that!

It looks like I now have myself a different kind of issue.  The insurance-tips portion has something going on that is throwing the browser into a redirect loop.  It appears that when I added the $ to it, it just changed the comparison string and causing it to go straight to HTTPS.  

Thanks for the help thus far.  Now I just have to figure out why it's going into the loop.  :)

Regards,
Ian

-----Original Message-----
From: Eugene [mailto:eugene.lysenko@gmail.com] 
Sent: Thursday, March 03, 2011 10:55 AM
To: users@httpd.apache.org
Subject: RE: [users@httpd] Rewrite Conditions & Rules

My mistake. Bottom part must be like this:

        RewriteCond %{REQUEST_URI} ^/$
        RewriteCond %{HTTPS}       on
        RewriteRule / http://www.website.com%{REQUEST_URI} [R,L]

        RewriteCond %{REQUEST_URI} ^/home
        RewriteCond %{HTTPS}       on
        RewriteRule / http://www.website.com%{REQUEST_URI} [R,L]

        RewriteCond %{REQUEST_URI} ^/insurance-tips
        RewriteCond %{HTTPS}       on
        RewriteRule / http://www.website.com%{REQUEST_URI} [R,L]

        RewriteCond %{REQUEST_URI} ^/add-a-tip
        RewriteCond %{HTTPS}       on
        RewriteRule / http://www.website.com%{REQUEST_URI} [R,L]


-----Original Message-----
From: Ian Stradling <Ia...@impalanetworks.com>
Reply-to: "users@httpd.apache.org" <us...@httpd.apache.org>
To: users@httpd.apache.org <us...@httpd.apache.org>
Subject: RE: [users@httpd] Rewrite Conditions & Rules
Date: Thu, 3 Mar 2011 17:39:33 +0000

No, unfortunately it doesn’t.  When a visitor first goes to the website, it stays in HTTP.  As soon as a visitor clicks on one of the HTTPS links, the rewrite rules will force HTTPS for the rest of the time that the visitor is on the site regardless of the links they click on.  

I need the Rewrite rules to be able to take it out of HTTPS when they click on a portion of the site that isn't HTTPS. The code all looks like it should work, but there's something strange going on with it.  It looks like the second set of code isn't firing.



-----Original Message-----
From: Eugene [mailto:eugene.lysenko@gmail.com] 
Sent: Thursday, March 03, 2011 9:33 AM
To: users@httpd.apache.org
Subject: RE: [users@httpd] Rewrite Conditions & Rules

Doesn't it fit your needs?

        RewriteCond %{REQUEST_URI} !^/$
        RewriteCond %{REQUEST_URI} !^/home   
        RewriteCond %{REQUEST_URI} !^/insurance-tips 
        RewriteCond %{REQUEST_URI} !^/add-a-tip  
        RewriteCond %{HTTPS}       off  
        RewriteRule / https://www.website.com%{REQUEST_URI} [R,L]

        RewriteCond %{REQUEST_URI} ^/$
        RewriteCond %{REQUEST_URI} ^/home
        RewriteCond %{REQUEST_URI} ^/insurance-tips
        RewriteCond %{REQUEST_URI} ^/add-a-tip
        RewriteCond %{HTTPS}       on
        RewriteRule / http://www.website.com%{REQUEST_URI} [R,L]


-----Original Message-----
From: Ian Stradling <Ia...@impalanetworks.com>
Reply-to: "users@httpd.apache.org" <us...@httpd.apache.org>
To: users@httpd.apache.org <us...@httpd.apache.org>
Subject: RE: [users@httpd] Rewrite Conditions & Rules
Date: Thu, 3 Mar 2011 16:05:54 +0000

Has anyone ever used mod_rewrite to try and force SSL on certain portions of a website?  

I feel like I'm running around in circles trying to figure it out.  As a point of reiteration, I'm using the following code:

	RewriteCond %{REQUEST_URI} !^/
	RewriteCond %{REQUEST_URI} !^/home   
	RewriteCond %{REQUEST_URI} !^/insurance-tips 
	RewriteCond %{REQUEST_URI} !^/add-a-tip  
	RewriteCond %{HTTPS} !=on  
	RewriteRule .* https://www.website.com/$1 [R,L]

I've tried implementing a couple of these but it never really does what I think it's supposed to do.  If someone could please point me in the right direction, I'd appreciate it.

Thanks!

-----Original Message-----
From: Ian Stradling [mailto:Ian@impalanetworks.com] 
Sent: Monday, February 28, 2011 12:40 PM
To: users@httpd.apache.org
Subject: [users@httpd] re: Rewrite Conditions & Rules

Hi Folks,

I'm new to the manual side of web administration, and am using Apache2 in a Debian Linux distribution.

I was asked by my boss to set up a situation where we force SSL on certain portions of a website, and turn it off when the viewer goes to another page on the site. I have decided to use mod_rewrite to do so.  I've read through and have come up with the below code.  

This set of code is on the base port 80 site.  I have created this code with the intent to rewrite the URL to SSL if the page is not the string.  

	RewriteCond %{REQUEST_URI} !^/
	RewriteCond %{REQUEST_URI} !^/home   
	RewriteCond %{REQUEST_URI} !^/insurance-tips 
	RewriteCond %{REQUEST_URI} !^/add-a-tip  
	RewriteCond %{HTTPS} !=on  
	RewriteRule .* https://www.website.com/$1 [R,L]


This set of code, I have written on the 443 SSL site.  

	RewriteCond %{REQUEST_URI} ^/home
	RewriteCond %{REQUEST_URI} ^/insurance-tips
	RewriteCond %{REQUEST_URI} ^/add-a-tip
	RewriteCond %{HTTPS} =on
	RewriteRule ^/(.*) http://www.website.com/$1 [R,L]

When you first go to the site, it behaves as I want it to and leaves everything as HTTP.  But when you go back to the home page, it is supposed to remove the HTTPS, but it does not.  I'm hoping that someone can critique my code here and tell me where I've gone wrong.  I appreciate any feedback.


Thanks!

Ian Stradling




---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org




---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Rewrite Conditions & Rules

Posted by Eugene <eu...@gmail.com>.
My mistake. Bottom part must be like this:

        RewriteCond %{REQUEST_URI} ^/$
        RewriteCond %{HTTPS}       on
        RewriteRule / http://www.website.com%{REQUEST_URI} [R,L]

        RewriteCond %{REQUEST_URI} ^/home
        RewriteCond %{HTTPS}       on
        RewriteRule / http://www.website.com%{REQUEST_URI} [R,L]

        RewriteCond %{REQUEST_URI} ^/insurance-tips
        RewriteCond %{HTTPS}       on
        RewriteRule / http://www.website.com%{REQUEST_URI} [R,L]

        RewriteCond %{REQUEST_URI} ^/add-a-tip
        RewriteCond %{HTTPS}       on
        RewriteRule / http://www.website.com%{REQUEST_URI} [R,L]


-----Original Message-----
From: Ian Stradling <Ia...@impalanetworks.com>
Reply-to: "users@httpd.apache.org" <us...@httpd.apache.org>
To: users@httpd.apache.org <us...@httpd.apache.org>
Subject: RE: [users@httpd] Rewrite Conditions & Rules
Date: Thu, 3 Mar 2011 17:39:33 +0000

No, unfortunately it doesn’t.  When a visitor first goes to the website, it stays in HTTP.  As soon as a visitor clicks on one of the HTTPS links, the rewrite rules will force HTTPS for the rest of the time that the visitor is on the site regardless of the links they click on.  

I need the Rewrite rules to be able to take it out of HTTPS when they click on a portion of the site that isn't HTTPS. The code all looks like it should work, but there's something strange going on with it.  It looks like the second set of code isn't firing.



-----Original Message-----
From: Eugene [mailto:eugene.lysenko@gmail.com] 
Sent: Thursday, March 03, 2011 9:33 AM
To: users@httpd.apache.org
Subject: RE: [users@httpd] Rewrite Conditions & Rules

Doesn't it fit your needs?

        RewriteCond %{REQUEST_URI} !^/$
        RewriteCond %{REQUEST_URI} !^/home   
        RewriteCond %{REQUEST_URI} !^/insurance-tips 
        RewriteCond %{REQUEST_URI} !^/add-a-tip  
        RewriteCond %{HTTPS}       off  
        RewriteRule / https://www.website.com%{REQUEST_URI} [R,L]

        RewriteCond %{REQUEST_URI} ^/$
        RewriteCond %{REQUEST_URI} ^/home
        RewriteCond %{REQUEST_URI} ^/insurance-tips
        RewriteCond %{REQUEST_URI} ^/add-a-tip
        RewriteCond %{HTTPS}       on
        RewriteRule / http://www.website.com%{REQUEST_URI} [R,L]


-----Original Message-----
From: Ian Stradling <Ia...@impalanetworks.com>
Reply-to: "users@httpd.apache.org" <us...@httpd.apache.org>
To: users@httpd.apache.org <us...@httpd.apache.org>
Subject: RE: [users@httpd] Rewrite Conditions & Rules
Date: Thu, 3 Mar 2011 16:05:54 +0000

Has anyone ever used mod_rewrite to try and force SSL on certain portions of a website?  

I feel like I'm running around in circles trying to figure it out.  As a point of reiteration, I'm using the following code:

	RewriteCond %{REQUEST_URI} !^/
	RewriteCond %{REQUEST_URI} !^/home   
	RewriteCond %{REQUEST_URI} !^/insurance-tips 
	RewriteCond %{REQUEST_URI} !^/add-a-tip  
	RewriteCond %{HTTPS} !=on  
	RewriteRule .* https://www.website.com/$1 [R,L]

I've tried implementing a couple of these but it never really does what I think it's supposed to do.  If someone could please point me in the right direction, I'd appreciate it.

Thanks!

-----Original Message-----
From: Ian Stradling [mailto:Ian@impalanetworks.com] 
Sent: Monday, February 28, 2011 12:40 PM
To: users@httpd.apache.org
Subject: [users@httpd] re: Rewrite Conditions & Rules

Hi Folks,

I'm new to the manual side of web administration, and am using Apache2 in a Debian Linux distribution.

I was asked by my boss to set up a situation where we force SSL on certain portions of a website, and turn it off when the viewer goes to another page on the site. I have decided to use mod_rewrite to do so.  I've read through and have come up with the below code.  

This set of code is on the base port 80 site.  I have created this code with the intent to rewrite the URL to SSL if the page is not the string.  

	RewriteCond %{REQUEST_URI} !^/
	RewriteCond %{REQUEST_URI} !^/home   
	RewriteCond %{REQUEST_URI} !^/insurance-tips 
	RewriteCond %{REQUEST_URI} !^/add-a-tip  
	RewriteCond %{HTTPS} !=on  
	RewriteRule .* https://www.website.com/$1 [R,L]


This set of code, I have written on the 443 SSL site.  

	RewriteCond %{REQUEST_URI} ^/home
	RewriteCond %{REQUEST_URI} ^/insurance-tips
	RewriteCond %{REQUEST_URI} ^/add-a-tip
	RewriteCond %{HTTPS} =on
	RewriteRule ^/(.*) http://www.website.com/$1 [R,L]

When you first go to the site, it behaves as I want it to and leaves everything as HTTP.  But when you go back to the home page, it is supposed to remove the HTTPS, but it does not.  I'm hoping that someone can critique my code here and tell me where I've gone wrong.  I appreciate any feedback.


Thanks!

Ian Stradling




---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org




---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Rewrite Conditions & Rules

Posted by Tom Evans <te...@googlemail.com>.
On Thu, Mar 3, 2011 at 5:45 PM, Ian Stradling <Ia...@impalanetworks.com> wrote:
> I apologize, I should have specified that I did use the set of rules that Eugene had adjusted.
>
> The result was the same as the rules I had been using previously.
>
> I appreciate the assistance.
>

I wasn't trying to be snarky, the difference was slight!

Hmm, ok, I would have thought that would have worked. Can you please
turn on RewriteLog (at at least "RewriteLogLevel 5"), and then trace
through a single request over SSL to a page that you think the rule
should redirect to non SSL.

That should give both of us a better idea of what is going on.

Cheers

Tom

---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Rewrite Conditions & Rules

Posted by Ian Stradling <Ia...@impalanetworks.com>.
I apologize, I should have specified that I did use the set of rules that Eugene had adjusted.  

The result was the same as the rules I had been using previously.  

I appreciate the assistance.  

-----Original Message-----
From: Tom Evans [mailto:tevans.uk@googlemail.com] 
Sent: Thursday, March 03, 2011 10:43 AM
To: users@httpd.apache.org
Subject: Re: [users@httpd] Rewrite Conditions & Rules

On Thu, Mar 3, 2011 at 5:39 PM, Ian Stradling <Ia...@impalanetworks.com> wrote:
> No, unfortunately it doesn’t.  When a visitor first goes to the website, it stays in HTTP.  As soon as a visitor clicks on one of the HTTPS links, the rewrite rules will force HTTPS for the rest of the time that the visitor is on the site regardless of the links they click on.
>
> I need the Rewrite rules to be able to take it out of HTTPS when they click on a portion of the site that isn't HTTPS. The code all looks like it should work, but there's something strange going on with it.  It looks like the second set of code isn't firing.
>
>
>

Did you notice that Eugene's rewrite rules were different from yours,
or did you dismiss it out of hand?

Cheers

Tom

---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Rewrite Conditions & Rules

Posted by Tom Evans <te...@googlemail.com>.
On Thu, Mar 3, 2011 at 5:39 PM, Ian Stradling <Ia...@impalanetworks.com> wrote:
> No, unfortunately it doesn’t.  When a visitor first goes to the website, it stays in HTTP.  As soon as a visitor clicks on one of the HTTPS links, the rewrite rules will force HTTPS for the rest of the time that the visitor is on the site regardless of the links they click on.
>
> I need the Rewrite rules to be able to take it out of HTTPS when they click on a portion of the site that isn't HTTPS. The code all looks like it should work, but there's something strange going on with it.  It looks like the second set of code isn't firing.
>
>
>

Did you notice that Eugene's rewrite rules were different from yours,
or did you dismiss it out of hand?

Cheers

Tom

---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Rewrite Conditions & Rules

Posted by Ian Stradling <Ia...@impalanetworks.com>.
No, unfortunately it doesn’t.  When a visitor first goes to the website, it stays in HTTP.  As soon as a visitor clicks on one of the HTTPS links, the rewrite rules will force HTTPS for the rest of the time that the visitor is on the site regardless of the links they click on.  

I need the Rewrite rules to be able to take it out of HTTPS when they click on a portion of the site that isn't HTTPS. The code all looks like it should work, but there's something strange going on with it.  It looks like the second set of code isn't firing.



-----Original Message-----
From: Eugene [mailto:eugene.lysenko@gmail.com] 
Sent: Thursday, March 03, 2011 9:33 AM
To: users@httpd.apache.org
Subject: RE: [users@httpd] Rewrite Conditions & Rules

Doesn't it fit your needs?

        RewriteCond %{REQUEST_URI} !^/$
        RewriteCond %{REQUEST_URI} !^/home   
        RewriteCond %{REQUEST_URI} !^/insurance-tips 
        RewriteCond %{REQUEST_URI} !^/add-a-tip  
        RewriteCond %{HTTPS}       off  
        RewriteRule / https://www.website.com%{REQUEST_URI} [R,L]

        RewriteCond %{REQUEST_URI} ^/$
        RewriteCond %{REQUEST_URI} ^/home
        RewriteCond %{REQUEST_URI} ^/insurance-tips
        RewriteCond %{REQUEST_URI} ^/add-a-tip
        RewriteCond %{HTTPS}       on
        RewriteRule / http://www.website.com%{REQUEST_URI} [R,L]


-----Original Message-----
From: Ian Stradling <Ia...@impalanetworks.com>
Reply-to: "users@httpd.apache.org" <us...@httpd.apache.org>
To: users@httpd.apache.org <us...@httpd.apache.org>
Subject: RE: [users@httpd] Rewrite Conditions & Rules
Date: Thu, 3 Mar 2011 16:05:54 +0000

Has anyone ever used mod_rewrite to try and force SSL on certain portions of a website?  

I feel like I'm running around in circles trying to figure it out.  As a point of reiteration, I'm using the following code:

	RewriteCond %{REQUEST_URI} !^/
	RewriteCond %{REQUEST_URI} !^/home   
	RewriteCond %{REQUEST_URI} !^/insurance-tips 
	RewriteCond %{REQUEST_URI} !^/add-a-tip  
	RewriteCond %{HTTPS} !=on  
	RewriteRule .* https://www.website.com/$1 [R,L]

I've tried implementing a couple of these but it never really does what I think it's supposed to do.  If someone could please point me in the right direction, I'd appreciate it.

Thanks!

-----Original Message-----
From: Ian Stradling [mailto:Ian@impalanetworks.com] 
Sent: Monday, February 28, 2011 12:40 PM
To: users@httpd.apache.org
Subject: [users@httpd] re: Rewrite Conditions & Rules

Hi Folks,

I'm new to the manual side of web administration, and am using Apache2 in a Debian Linux distribution.

I was asked by my boss to set up a situation where we force SSL on certain portions of a website, and turn it off when the viewer goes to another page on the site. I have decided to use mod_rewrite to do so.  I've read through and have come up with the below code.  

This set of code is on the base port 80 site.  I have created this code with the intent to rewrite the URL to SSL if the page is not the string.  

	RewriteCond %{REQUEST_URI} !^/
	RewriteCond %{REQUEST_URI} !^/home   
	RewriteCond %{REQUEST_URI} !^/insurance-tips 
	RewriteCond %{REQUEST_URI} !^/add-a-tip  
	RewriteCond %{HTTPS} !=on  
	RewriteRule .* https://www.website.com/$1 [R,L]


This set of code, I have written on the 443 SSL site.  

	RewriteCond %{REQUEST_URI} ^/home
	RewriteCond %{REQUEST_URI} ^/insurance-tips
	RewriteCond %{REQUEST_URI} ^/add-a-tip
	RewriteCond %{HTTPS} =on
	RewriteRule ^/(.*) http://www.website.com/$1 [R,L]

When you first go to the site, it behaves as I want it to and leaves everything as HTTP.  But when you go back to the home page, it is supposed to remove the HTTPS, but it does not.  I'm hoping that someone can critique my code here and tell me where I've gone wrong.  I appreciate any feedback.


Thanks!

Ian Stradling




---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Rewrite Conditions & Rules

Posted by Eugene <eu...@gmail.com>.
Doesn't it fit your needs?

        RewriteCond %{REQUEST_URI} !^/$
        RewriteCond %{REQUEST_URI} !^/home   
        RewriteCond %{REQUEST_URI} !^/insurance-tips 
        RewriteCond %{REQUEST_URI} !^/add-a-tip  
        RewriteCond %{HTTPS}       off  
        RewriteRule / https://www.website.com%{REQUEST_URI} [R,L]

        RewriteCond %{REQUEST_URI} ^/$
        RewriteCond %{REQUEST_URI} ^/home
        RewriteCond %{REQUEST_URI} ^/insurance-tips
        RewriteCond %{REQUEST_URI} ^/add-a-tip
        RewriteCond %{HTTPS}       on
        RewriteRule / http://www.website.com%{REQUEST_URI} [R,L]


-----Original Message-----
From: Ian Stradling <Ia...@impalanetworks.com>
Reply-to: "users@httpd.apache.org" <us...@httpd.apache.org>
To: users@httpd.apache.org <us...@httpd.apache.org>
Subject: RE: [users@httpd] Rewrite Conditions & Rules
Date: Thu, 3 Mar 2011 16:05:54 +0000

Has anyone ever used mod_rewrite to try and force SSL on certain portions of a website?  

I feel like I'm running around in circles trying to figure it out.  As a point of reiteration, I'm using the following code:

	RewriteCond %{REQUEST_URI} !^/
	RewriteCond %{REQUEST_URI} !^/home   
	RewriteCond %{REQUEST_URI} !^/insurance-tips 
	RewriteCond %{REQUEST_URI} !^/add-a-tip  
	RewriteCond %{HTTPS} !=on  
	RewriteRule .* https://www.website.com/$1 [R,L]

I've tried implementing a couple of these but it never really does what I think it's supposed to do.  If someone could please point me in the right direction, I'd appreciate it.

Thanks!

-----Original Message-----
From: Ian Stradling [mailto:Ian@impalanetworks.com] 
Sent: Monday, February 28, 2011 12:40 PM
To: users@httpd.apache.org
Subject: [users@httpd] re: Rewrite Conditions & Rules

Hi Folks,

I'm new to the manual side of web administration, and am using Apache2 in a Debian Linux distribution.

I was asked by my boss to set up a situation where we force SSL on certain portions of a website, and turn it off when the viewer goes to another page on the site. I have decided to use mod_rewrite to do so.  I've read through and have come up with the below code.  

This set of code is on the base port 80 site.  I have created this code with the intent to rewrite the URL to SSL if the page is not the string.  

	RewriteCond %{REQUEST_URI} !^/
	RewriteCond %{REQUEST_URI} !^/home   
	RewriteCond %{REQUEST_URI} !^/insurance-tips 
	RewriteCond %{REQUEST_URI} !^/add-a-tip  
	RewriteCond %{HTTPS} !=on  
	RewriteRule .* https://www.website.com/$1 [R,L]


This set of code, I have written on the 443 SSL site.  

	RewriteCond %{REQUEST_URI} ^/home
	RewriteCond %{REQUEST_URI} ^/insurance-tips
	RewriteCond %{REQUEST_URI} ^/add-a-tip
	RewriteCond %{HTTPS} =on
	RewriteRule ^/(.*) http://www.website.com/$1 [R,L]

When you first go to the site, it behaves as I want it to and leaves everything as HTTP.  But when you go back to the home page, it is supposed to remove the HTTPS, but it does not.  I'm hoping that someone can critique my code here and tell me where I've gone wrong.  I appreciate any feedback.


Thanks!

Ian Stradling




---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Rewrite Conditions & Rules

Posted by Ian Stradling <Ia...@impalanetworks.com>.
Has anyone ever used mod_rewrite to try and force SSL on certain portions of a website?  

I feel like I'm running around in circles trying to figure it out.  As a point of reiteration, I'm using the following code:

	RewriteCond %{REQUEST_URI} !^/
	RewriteCond %{REQUEST_URI} !^/home   
	RewriteCond %{REQUEST_URI} !^/insurance-tips 
	RewriteCond %{REQUEST_URI} !^/add-a-tip  
	RewriteCond %{HTTPS} !=on  
	RewriteRule .* https://www.website.com/$1 [R,L]

I've tried implementing a couple of these but it never really does what I think it's supposed to do.  If someone could please point me in the right direction, I'd appreciate it.

Thanks!

-----Original Message-----
From: Ian Stradling [mailto:Ian@impalanetworks.com] 
Sent: Monday, February 28, 2011 12:40 PM
To: users@httpd.apache.org
Subject: [users@httpd] re: Rewrite Conditions & Rules

Hi Folks,

I'm new to the manual side of web administration, and am using Apache2 in a Debian Linux distribution.

I was asked by my boss to set up a situation where we force SSL on certain portions of a website, and turn it off when the viewer goes to another page on the site. I have decided to use mod_rewrite to do so.  I've read through and have come up with the below code.  

This set of code is on the base port 80 site.  I have created this code with the intent to rewrite the URL to SSL if the page is not the string.  

	RewriteCond %{REQUEST_URI} !^/
	RewriteCond %{REQUEST_URI} !^/home   
	RewriteCond %{REQUEST_URI} !^/insurance-tips 
	RewriteCond %{REQUEST_URI} !^/add-a-tip  
	RewriteCond %{HTTPS} !=on  
	RewriteRule .* https://www.website.com/$1 [R,L]


This set of code, I have written on the 443 SSL site.  

	RewriteCond %{REQUEST_URI} ^/home
	RewriteCond %{REQUEST_URI} ^/insurance-tips
	RewriteCond %{REQUEST_URI} ^/add-a-tip
	RewriteCond %{HTTPS} =on
	RewriteRule ^/(.*) http://www.website.com/$1 [R,L]

When you first go to the site, it behaves as I want it to and leaves everything as HTTP.  But when you go back to the home page, it is supposed to remove the HTTPS, but it does not.  I'm hoping that someone can critique my code here and tell me where I've gone wrong.  I appreciate any feedback.


Thanks!

Ian Stradling



---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org