Apache 重新使用https://www.subdomain.domain.com/ 到https://subdomain.domain.com

Apache 重新使用https://www.subdomain.domain.com/ 到https://subdomain.domain.com,apache,.htaccess,mod-rewrite,Apache,.htaccess,Mod Rewrite,我想重定向到,我们已将其包含在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 ^ ht

我想重定向到,我们已将其包含在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]

您有www.subdomain.domain.com或subdomain.domain.com的证书吗?