使用.htaccess将所有请求重定向到根URL

时间:2012-05-03 12:18:37

标签: .htaccess redirect

我对.htaccess规则很糟糕,所以你能帮忙解决这个问题吗?

我正在寻找这种情况:

No matter what subdomain the request is for, the visitor is 301'd to the root of the domain.

所以,例如:

但是,仅适用于index.html

提前感谢大家的帮助!

1 个答案:

答案 0 :(得分:0)

RedirectMatch 301 (.*)doma.in(.*)$ http://doma.in$2几乎所有“doma.in之前的内容都会被忽略,但域名之后的所有内容都会被正常重定向(通知$2$1就是域名”doma.in之前的所有内容“但我认为你不需要......如果你告诉我,我会编辑我的答案”

希望它有所帮助

相关问题