I have a site with two domains. I want that whenever domain X is visited (no matter what the path is... /foo/bar/, root or whatever), the browser should redirect to a specific URL.
So:
domainX.com -> domainX.com
domainY.com -> domainX.com/some/path
The following kinda sorta works, but it only matches against domainY.com
, so www.domainY.com
or domainY.com/some/path
doesn't work.
RewriteCond %{HTTP_HOST} ^domainY\.com
RewriteRule ^(.*)$ http://domainX\.com/some/path [L]
It has to accept both with and without www before though. Any ideas?