如何使用htaccess重定向通配符子域

问题描述:

有人可以帮助我使用这个htaccess,我只想要http://subdomain.example.com/login - > http://www.example.com/login



我的尝试:



RewriteEngine on

RewriteCond%{HTTP_HOST} ^(。+)。example.com \ login [NC]

RewriteCond%{HTTP_HOST}!^ www.example.com $ [NC]

RewriteRule ^(。*)$ http://www.example.com/login/$1 [L,NC,QSA]

Can someone please help me with this htaccess, I just want http://subdomain.example.com/login -> http://www.example.com/login

What I have tried:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^(.+).example.com\login [NC]
RewriteCond %{HTTP_HOST} !^www.example.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/login/$1 [L,NC,QSA]

[NC]

RewriteRule ^(。*)
[NC]
RewriteRule ^(.*)


http://www.example.com/login /
http://www.example.com/login/


1 [L,NC,QSA]
1 [L,NC,QSA]