Welcome to WebmasterWorld Guest from 34.201.121.213

Forum Moderators: Ocean10000 & phranque

Message Too Old, No Replies

https to http but exempt certain urls

     
10:33 pm on Oct 31, 2006 (gmt 0)

Junior Member

10+ Year Member

joined:Mar 11, 2005
posts:45
votes: 0


Hi

I knoe that

RewriteCond %{SERVER_PORT} ^443$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]

will redirect all https urls to http but I would like to exempt my checkout urls from doing this and make them secure

the reson for this is that google has indexed certain pages including my home page as https

can anyone advise if this is possible

thanks

11:41 pm on Oct 31, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 9, 2005
posts:1509
votes: 0


You will probably need to use a %{REQUEST_URI} condition in the rule.

Don't have any examples bookmarked right now, but you should be able to find what you need in the library or with a site: search.

Justin

9:21 pm on Nov 15, 2006 (gmt 0)

Junior Member

10+ Year Member

joined:Mar 11, 2005
posts:45
votes: 0


Hi I am stuck

I looked at REQUEST_URI but I understand it but I want to say rewrit everything from https to http except these 4 url's that are in the same directory as everything else

is this possible. I know with REQUEST_URI i could put if it is this file re-write ect but there is 300 files to do I would like to rewrite everything except 4 files

If you know what I mean

Thanks

9:59 pm on Nov 15, 2006 (gmt 0)

Junior Member

10+ Year Member

joined:Sept 19, 2005
posts:44
votes: 0


I'm doing just that on my web site. I don't wany my home page to be served up via https. Only http. Here's a snippet from my configuration:


<VirtualHost _default_:443>
...
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/$ [OR]
RewriteCond %{REQUEST_URI} ^/index.htm$
RewriteRule ^.*$ http://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
...
</VirtualHost>

I've had this for a couple years now; it's pretty solid.

10:01 pm on Nov 15, 2006 (gmt 0)

Junior Member

10+ Year Member

joined:Sept 19, 2005
posts:44
votes: 0


In case I didn't make it clear, since my rewrite rules are inside the virtualhost config for port 443, I don't have to check for the port number in the rewrite rules.