Forum Moderators: phranque

Message Too Old, No Replies

https to http but exempt certain urls

         

fzx5v0

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

10+ Year Member



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

jd01

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

WebmasterWorld Senior Member 10+ Year Member



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

fzx5v0

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

10+ Year Member



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

crevier

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

10+ Year Member



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.

crevier

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

10+ Year Member



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.