this is rather a quick one: How do I redirect to another domain and still forward the subdomain? Example: http://foo.domainone.com/bar.php -> http://foo.domaintwo.com/bar.php
Thanks in advance!
domainnginxrewritesubdomain
this is rather a quick one: How do I redirect to another domain and still forward the subdomain? Example: http://foo.domainone.com/bar.php -> http://foo.domaintwo.com/bar.php
Thanks in advance!
Best Answer
Something along the following lines should work for you (this will redirect test.com to abc.com):
This should ensure the naked domain and any sub (or sub, sub) domains are redirected to the new "base" domain. A few examples of this in practice:
On the rewrite line you could specify "last" rather than "permanent" to get a 302 Moved Temporarily rather than a 301 Moved Permanently. If you are moving domains the later is what you should be going for :)
Hope this helps.