我需要重写规则的帮助。
所以我想要这些地址:
http://domain.com http://www.domain.com https://www.domain.com
redirect到:
https://domain.com
有人能帮我吗?
现在我有规则:
RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://domain.com/$1 [R,L] But it doesnt redirect https://www to https://
将此规则放在您的DOCUMENT_ROOT/.htaccess
文件中:
RewriteEngine On RewriteCond %{HTTPS} off [OR] RewriteCond %{HTTP_HOST} www\. RewriteRule ^ https://domain.com%{REQUEST_URI} [L,R=301,NE]