Reputation: 3272
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 specifically for this one.
Thanks for the help
Upvotes: 3
Views: 11504
Reputation: 6928
Simplest way of redirecting a subdirectory to a domain:
RedirectMatch 301 ^/subdir/$ http://example.com$1
Upvotes: 0
Reputation: 125204
RewriteCond %{HTTP_HOST} ^xyz\.domain\.com$
RewriteRule ^/(.*) http://domain.com/$1 [redirect,last]
Upvotes: 5