htaccess does not understand ^www\. rule , if paramters are appended to url

后端 未结 2 1202
青春惊慌失措
青春惊慌失措 2021-01-24 22:39

.htaccess does not understand ^www\\. rule

#do not use this, because i want to redirect from https://www.somedomain.com
#RewriteCond %{HTTPS} off 
         


        
2条回答
  •  被撕碎了的回忆
    2021-01-24 23:03

    You have an additional condition with [OR] that can cause too many redirects. Fix it by using:

    RewriteCond %{HTTPS} off [OR]
    RewriteCond %{HTTP_HOST} ^www\.somedomain\.com$ [NC]
    RewriteRule ^/?$ https://somedomain.com [L,R=301]
    

    Completely clear browser cache before testing this.

提交回复
热议问题