mods - please move to correct forum after I have had some eyes look at this - it's urgent.
The problem - we have 3 domains all pointing to the same webspace. The underlying code determines what to serve up depending on the requesting url.
The application also need url rewriting for the underlying app (written using cakePHP)
We also have some old urls bookmarks that we need redirect.
my domains:
domain1.com domain2.com domain2.co.uk
I need domain2.co.uk to automagically redirect to domain2.com I need any of the domains with a /international to redirect to domain1.com
Then there is the basic rewrite for cakephp
my .htacces looks like this
RewriteEngine On RewriteBase / Options -Indexes Options +FollowSymLinks RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f
Redirect /internationalhttp://www.domain1.com [L] Redirect domain2.co.ukhttp://www.domain2.com [L]
RewriteRule .*$ index.php?url=$1 [qsa]
I have 2 problems
domain2.co.uk does not redirect to domain1.com
any request suffixed with /international is being rewritten by the last rule: ?url=international
what am I missing, what am i doing wrong?
To redirect the domain:
rewritecond %{http_host} domain2.co.uk [nc] rewriterule .*$http://domain2.com/$1 [r=301,nc]
...you might need to do some extra work to catch different versions of the original URL (eg. ww w .domain.co.uk *)
*spaces to prevent the URL from being rewritten by the forum software)
For the /international bit:
rewritecond %{REQUEST_FILENAME} /international [nc] rewriterule .*$http://domain1.com [r=301,nc]
Originally posted by: Stickman For the /international bit:
rewritecond %{REQUEST_FILENAME} /international [nc] rewriterule .*$http://domain1.com [r=301,nc]
Thanks Stick but that's not working - I need the page to redirect so that URL is set to domain1.com
The forum software has removed the http :// from the front of the domain name. Add it back in and try again.
stupid forum software
Thanks Stickman
mods, do yer stuff, thanks.