如何将所有网页重定向到非www https?
http://example.com/* -> https://example.com/*
http://www.example.com/* -> https://example.com/*
https://www.example.com/* -> https://example.com/*
由于
答案 0 :(得分:2)
使用:
RewriteCond %{HTTP_HOST} ^www\.(.+) [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [NE,L,R=301]
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [NE,L,R=301]