如何删除htaccess中仅一个.php文件的https重定向



我只想为一个.php文件删除网页的https重定向。我发现了这个,但我不知道如何设置我的.php方向。提前感谢

.php文件=www.myhost.com/myphp.php

# force http:// for selected URLs
RewriteCond %{HTTPS} on
RewriteCond %{THE_REQUEST} /commerce_paypal/ [NC]
RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

您的情况已经逆转。你需要使用这个:

# force https:// to all but selected URLs
RewriteCond %{HTTPS} !on
RewriteCond %{THE_REQUEST} !s/+myfile.php [NC]
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# force http:// to selected URLs
RewriteCond %{HTTPS} on
RewriteCond %{THE_REQUEST} s/+myfile.php [NC]
RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

最新更新