Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想将 https://www.subdomain.domain.com/ 重定向到https://subdomain.domain.com ,我们已将其包含在 htaccess 文件中,但它不起作用:
RewriteCond %{HTTPS_HOST} ^www\.([^.]+)\.domian\.com$ RewriteRule ^(.*)$ https:// %1.domian.com/$1 [L,R]
这会将所有 https 和 www 重定向到非 www 等效项:
RewriteCond %{HTTPS}=on RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] RewriteRule ^ https://%1%{REQUEST_URI} [R,L]