Page 1 of 1
301 permanent redirection except secure domain
Posted: Mon Mar 23, 2009 8:37 am
by basudeb
My site url is
http://mydomain.com but in payment section the url is secured(shared). I want to redirect from
http://mydomain.com to
http://www.mydomain.com .But the payment pages the urls should be same as it is . How can set the Rewrite rule for .htacess files.. Need Some suggestion ...
Re: 301 permanent redirection except secure domain
Posted: Mon Mar 23, 2009 8:56 am
by kaisellgren
Re: 301 permanent redirection except secure domain
Posted: Fri Mar 27, 2009 6:07 pm
by jceresini
This will redirect anyone who accesses your site on port 80 to the https site and keep them on the same page they attempted to visit.
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$
https://www.example.com/$1 [R=301,L]
Joe Ceresini
Network Engineer
jceresini@hostmysite.com
HostMySite.com
Re: 301 permanent redirection except secure domain
Posted: Tue Apr 21, 2009 2:11 pm
by gregor171
you can simply redirect it by checking where request came from
$_SERVER['SERVER_NAME']
to see if it's https:
$_SERVER['HTTPS']
and redirect it with header() function.