开发者

Mod_Rewrite: Force https besides specific page

开发者 https://www.devze.com 2023-02-14 12:06 出处:网络
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 http

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?

0

精彩评论

暂无评论...
验证码 换一张
取 消