【发布时间】:2018-09-15 17:12:11
【问题描述】:
我正在尝试将https://demo.aurazoscript.com/surf.php?id=15 重定向到http://demo.aurazoscript.com/surf.php?id=15。我在 .htaccess 中尝试了以下操作,但这不起作用。它关闭了我不想要的整个网站的强制 HTTPS 重定向。我只希望为该单页 surf.php 关闭它。
我在 .htaccess 中尝试过
# FORCE HTTPS
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} \/(surf.php)
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
# DISABLE HTTPS
RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} !\/(surf.php) [NC]
RewriteRule ^(.*)$ http://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
我正在使用来自 CloudFlare 的灵活 SSL。
【问题讨论】:
标签: apache .htaccess http ssl https