Zack
asked on
Rewriting URL
Hi All,
I want to rewrite anything (root or subfolder) of the following domain (as an example): I have other rewrite rules that I don't want to conflict with for the shopping cart.
http://www.test.com to http://test.com
and https://www.test.com to http://test.com
I screwed up on my SSL and didn't realize I should've requested www.<domain>.com. In IE it is coming up invalid certificate when I goto www.<domain>.com
Thanks - Zack
I want to rewrite anything (root or subfolder) of the following domain (as an example): I have other rewrite rules that I don't want to conflict with for the shopping cart.
http://www.test.com to http://test.com
and https://www.test.com to http://test.com
I screwed up on my SSL and didn't realize I should've requested www.<domain>.com. In IE it is coming up invalid certificate when I goto www.<domain>.com
Thanks - Zack
ASKER
Hmmm for some reason the top works but the https doesn't.
Ok try this instead:
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{SERVER_PORT} 80
RewriteCond %{HTTP_HOST} www.test.com
RewriteRule (.*) http://test.com%{REQUEST_URI} [R=301,L]
RewriteCond %{SERVER_PORT} 443
RewriteCond %{HTTP_HOST} www.test.com
RewriteRule (.*) https://test.com%{REQUEST_URI} [R=301,L]
ASKER
We're making progress lol.
It works on firefox but not on IE. Is there some sort of stupid security thing in IE that you know of?
It works on firefox but not on IE. Is there some sort of stupid security thing in IE that you know of?
What does it do on IE?
And which version of IE?
And which version of IE?
ASKER
it doesn't do anything it loads the url as usual disregarding the htts rewrite but the http works fine
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ok I understand what's happening with IE. It's popping up an invalid SSL cert (because the SSL cert isn't good for www. Once you acknowledge the invalid cert the rewrite does work.
I appreciate your help!
Thanks Zack
I appreciate your help!
Thanks Zack
Open in new window
Please note these must be at the top of your .htaccess / rewrites - or else it won't work