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
精彩评论