简体   繁体   English

SSL:HTTP www重定向到非www HTTPS

[英]SSL: HTTP www redirect to non www HTTPS

sorry about links put can only post 2 beacuse i am new on the forum. 对不起,放置的链接只能发布2,因为我是论坛上的新手。

My problem is with my site https//freespinslista.se/ which is working fine but when i type in the web address field www.freespinslista.se I am coming to https://www.freespinslista.se/ 我的问题出在我的网站https // freespinslista.se /上,它工作正常,但是当我在网址字段www.freespinslista.se中键入内容时,我将访问https://www.freespinslista.se/

I only have SSL for without www so I dont want traffic to https//www.freespinslista.se/ because then it gives you a security warning. 我只有没有www的SSL,所以我不希望访问https // www.freespinslista.se /的流量,因为那样会给您带来安全警告。

I want www typers to go to http://www.freespinslista.se/ and there simply to redirect straight to https//freespinslista.se/ so that there will be no security warning. 我希望www打字员转到http://www.freespinslista.se/,然后直接将其直接重定向到https // freespinslista.se /,这样就不会出现安全警告。

HOW DO I MAKE www typers go to http and redirect to non www https while non www typers still goes to https? 我如何使www打字员转到http并重定向到非www https,而非www打字员仍转到https?

my .htaccess looks like this: 我的.htaccess看起来像这样:

   <IfModule mod_rewrite.c>
   RewriteEngine on
   RewriteBase /
   RewriteCond %{HTTPS} off
   RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
  </IfModule>

Thanks a lot for any help 非常感谢您的帮助

You need to use rewrite condition to HTTP_HOST. 您需要对HTTP_HOST使用重写条件。 Look at this example htaccess mod_rewrite hostname 看这个例子htaccess mod_rewrite主机名

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

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