Is it possible to configure a top-domain (http://x.com
) (DNS/.htaccess/else?) to redirect to another domain (http://y.com
), whilst if you navigate http://x.com/subdir/index.html
, you'd see the files in the subdirectory of http://x.com
?
summarized
how to:
x.com -> y.com
(redirect)
x.com/sub/index.html
-> x.com/sub/index.html
(no redirect)
Case use
I've got sanderschaeffer.nl
and iscs.nl
, which are both my business names. One is my own personal name, the other my brand name. When a user navigates to sanderschaeffer.nl
, the domain should be forward (301) to iscs.nl
. However, when one types (i.e.) sanderschaeffer.nl/clientTestSite/
it would stay on that spot. So only the top-level gets a 301 redirect, but typing in the top-domain including a subdirectory will result in NO redirect.
For one saying 'Why don't you use the test sites in a subdirectory on the main site (iscs.nl/
)?'; that's because I'm testing (temporarily) out a new server, where sanderschaeffer.nl
currently is hosted on. :)