简体   繁体   English

htaccess https从非www到www的修订

[英]htaccess https rediraction from non-www to www

Here is the issue; 这是问题所在; The page I faced with problem is https://gomlekchim.com/ . 我遇到问题的页面是https://gomlekchim.com/

If you are using chrome or some other browser, it will alert you with SSL Error. 如果您使用的是chrome或其他浏览器,它将通过SSL错误提醒您。 That is normal because we only have certificate for www domain. 这很正常,因为我们只有www域的证书。 So, what I need is to directing this page to a www page which is http//www.gomlekchim.com. 因此,我需要将该页面定向到一个http:///www.gomlekchim.com的www页面。 That page might be http or https. 该页面可能是http或https。 Either works for me. 要么为我工作。

I didn't test it but this should work 我没有测试,但这应该可以

Options +FollowSymLinks 

RewriteEngine on

RewriteCond %{HTTP_HOST} !^www\.gomlekchim\.com$ [NC]
RewriteCond %{HTTPS} =on
RewriteRule ^(.*)$ https://www.gomlekchim.com/$1 [R=301,L,QSA]

RewriteCond %{HTTP_HOST} !^www\.gomlekchim\.com$
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ http://www.gomlekchim.com/$1 [R=301,L,QSA]

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

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