.htaccess 强制非安全页面重定向到具有htaccess的安全页面
很抱歉,我没有代码,但我不认为粘贴不正确的东西有什么意义 我想使用htaccess,以便以下url组合重定向:.htaccess 强制非安全页面重定向到具有htaccess的安全页面,.htaccess,.htaccess,很抱歉,我没有代码,但我不认为粘贴不正确的东西有什么意义 我想使用htaccess,以便以下url组合重定向: http:// www.mysite.com http:// mysite.com https:// www.mysite.com 所有这些都应该将用户重定向到 https:// mysite.com 感谢您的指导。要强制使用https和非www,您可以使用: RewriteEngine on RewriteCond %{HTTP_HOST} ^www\. [OR] Rewr
http:// www.mysite.com
http:// mysite.com
https:// www.mysite.com
所有这些都应该将用户重定向到
https:// mysite.com
感谢您的指导。要强制使用https和非www,您可以使用:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\. [OR]
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$
RewriteRule ^ https://%1%{REQUEST_URI} [NE,L,R]