开发者

Apache .htaccess redirect subdomain to parent domain

I want to redirect my subdomain

http://xyz.domain.com to http://domain.com

and similarly any subdirectories like

http://xyz.domain.com/abc to http://domain.com/abc

I don't want redirection for all my subdomains but specifical开发者_如何学Cly for this one.

Thanks for the help


RewriteCond %{HTTP_HOST} ^xyz\.domain\.com$
RewriteRule ^/(.*) http://domain.com/$1 [redirect,last]


Simplest way of redirecting a subdirectory to a domain:

RedirectMatch 301 ^/subdir/$  http://example.com$1
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜