Mod_Rewrite: Force https besides specific page
I have an application that requires SSL in a folder called "secure".
So within the "secure" folder of my site in the .htaccess file I'm using the following 开发者_StackOverflowcode to force https:// on that section of the site:
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} secure
RewriteRule ^(.*)$ https://domain.com/secure/$1 [R,L]
How could I modify this so that domain.com/secure/pay/callback would be able to use regular http://
Thank you.
Just add an exclusion
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} secure
RewriteCond %{REQUEST_URI} !/secure/pay/callback
RewriteRule ^(.*)$ https://domain.com/secure/$1 [R,L]
That's a pretty specific case, though; is that enough?
精彩评论