我有Drupal网站。
我已经检查了所有下面的链接,但是要么它们没有重定向,要么我得到一个错误站点有太多的重定向。
我需要将我的完整站点HTTP重定向到HTTPS,只有两页除外:-
下面的代码片段将完整的站点重定向到HTTPS,没有任何问题,但我需要逃离Home & products页面&为此,我尝试了超过10-15个组合。
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www.hello\.com*
RewriteRule ^(.*)$ https://hello.com/$1 [L,R=301]任何帮助都非常感谢。
发布于 2016-05-08 10:15:30
您可以使用:
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\.hello\.com
RewriteCond %{REQUEST_URI} !^/products/?$ [NC]
RewriteRule ^(.+)$ https://hello.com/$1 [L,R=301]发布于 2016-05-08 12:17:32
好的,让我们来试试,这是你的代码:
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www.hello\.com*
RewriteRule ^(.*)$ https://hello.com/$1 [L,R=301]将其更改为:
RewriteEngine on
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www.hello\.com*
RewriteCond %{SCRIPT_FILENAME} !products [NC]
RewriteRule ^(.+)$ https://hello.com/$1 [L,R=301]如果你不做你想做的事,请试一试,让我知道。
https://stackoverflow.com/questions/37098643
复制相似问题