如何使用htaccess重定向通配符子域 [英] How to redirect wildcard subdomain using htaccess
本文介绍了如何使用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]
这篇关于如何使用htaccess重定向通配符子域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文