redirect to https

Fix it!!

redirect to https

Postby bighippo » Thu Jul 10, 2008 7:04 pm

is it possible to do this:


if the URL is https://www.domain.com/~test/index.php
it will be redirected to http://www.domain.com/~test /index.php

but if i access.. or (im checking out items) https://www.domain.com/~test/index.php?page=checkout.index
the page will stay in https

in short... redirect me to https if im only checking out items...


thanks in advance
bighippo
 
Posts: 1
Joined: Thu Jul 10, 2008 6:02 pm

Postby richardk » Sun Jul 13, 2008 10:47 am

Try
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{SERVER_PORT} ^443$
RewriteCond %{REQUEST_URI}?%{QUERY_STRING} !^/~test/index\.php\?page=checkout\.index$ [NC]
RewriteRule .* http://www.domain.com%{REQUEST_URI} [R=301,L]

RewriteCond %{SERVER_PORT} ^80$
RewriteCond %{REQUEST_URI}?%{QUERY_STRING} ^/~test/index\.php\?page=checkout\.index$ [NC]
RewriteRule .* https://www.domain.com%{REQUEST_URI} [R=301,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Security with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 5 guests

cron