.htaccess 中的 https 到 http,但有例外
我已经做了足够的研究来弄清楚,要将站点范围内的所有 https 页面重定向到它们的 http 等效项,我需要使用此代码...
RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
我的问题是,有一个页面句柄我仍然希望保留为 https 。举例来说,假设我希望 page1.php、page2.php 和 page3.php 保留为 .https,而网站上的其他所有内容都进行重定向。有人知道该怎么做吗?
I've done enough research to figure out that to redirect sitewide all of my https pages to their http equivalent, I need to use this code...
RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
My issue is, there are a handle of pages that I still want to remain as https. For the sake of example, let's say I want page1.php, page2.php, and page3.php to REMAIN as .https, with everything else on the site redirecting. Anyone know how to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试这样的事情:
Try something like this: