Hi guys,
I'm having trouble setting up htaccess to redirect all other domains to a single domain whilst passing the URI.
I have a number of domains pointing to the same directory so all execute the same .htaccess file when requested, and wanted to do a conditional redirect instruction for all other domains.
Say I own example1.com, example2.com, example3.com (all serving from the same directory on the server) and want to redirect all to newexample.com- this I can do no problems. However I want requests to example1.com/somepage to resolve at newexample.com/somepage
(same applies to other domains).
Here's what I've been working with:
RewriteCond %{HTTP_HOST} !^newexample.com/$
RewriteRule (.*) http://newexample.com/$1 [R=301,L]
I'm having difficulty passing the URI in the redirect- anyone know how to do this?
Thanks!