Limit htaccess to tld or append location to end
For a site with shopping cart we have https working on the domain.com/shop-2/cart location. When a user leaves the cart to other links on the 开发者_运维问答site they are still sitting in HTTPS mode which is slow and actually gives an error b/c items on other pages are not setup for https connections.
I've been able to successfully detect https requests and redirect them to http but it's not appending the current user location (ie https:// domain.com/test should be http:// domain.com/test but comes out http:// domain.com). I've appended the redirect code I'm working with so far. I'm trying to get it to leave shop-2 alone since I want an SSL connection there.
RewriteEngine On
RewriteCond %{ENV:HTTPS} =on
RewriteCond %{REQUEST_URI} !^/shop-2
RewriteRule (.*) http://domain.com/%1 [R=301,L]
We're working on a Rackspace Cloud Sites server hence the ENV:HTTPS. HTTPS alone doesn't actually detect that we're on HTTPS because of some proxy layer on a different IP.
The spaces are in the domain examples b/c I don't have enough rep to post more than 2 links.
RewriteRule (.*) http://domain.com/$1 [R=301,L]
$
is the signifier for a group, not %
.
精彩评论