繁体   English   中英

如何将http重定向到除特定页面之外的https,然后将https重定向到同一页面的http?

[英]How can I redirect http to https except a specific page, then redirect https to http for that same page?

我将所有流量从http重定向到除特定页面之外的https,但是我希望在该特定页面上将https重定向到http。 我该怎么做。 以下是到目前为止的内容。

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !^/page
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

我弄清楚了,我将上面的内容保留在httpd.conf文件中,然后在页面目录中编辑了.htaccess文件并添加了以下代码。

RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM