【发布时间】:2021-04-10 07:33:27
【问题描述】:
这是
http 转 https
非 www 到 www
#http -> https
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
#add www.
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTP_HOST} ^(.*)$ [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
我不知道反码^^;;
https 转 http
www 到非 www
htaccess 中的规则如何? 谢谢
【问题讨论】:
标签: redirect http-status-code-301