0
我使用的是后续的.htaccess代码做以下域名不带www的SSL:简化重定向
- 重定向的example.com https://example.com
- 重定向到wwww.example.com https://example.com
- 重写任何东西来后
/$1
到index.php?get=$1
的.htaccess
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^(?:www.)?(.*)$ [NC]
RewriteRule^https://%1%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTP_HOST} ^www.(.+)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
RewriteRule ^([^.]+)/?$ index.php?get=$1 [L]
这工作正常,但这个代码仍然可以简化?
有趣的,这增加了一个额外线。 – IMB
是的,但少一条规则 – anubhava