I have my cakephp .htaccess files set up as in the cookbook and everything is working fine.
My web site currently has multiple domains, all of which point to the same site (e.g. www.site.com, www.site.co.uk). I'd like to set up a rule so that requests to www.site.co.uk/page are permanently redirected to www.site.com/page, etc.
I'm having trouble getting both rules to work together. Can anyone help me out?
EDITED TO INCLUDE FURTHER DETAILS:
Here is the .htaccess file in my web root:
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine on
# Force domain to be www.atdbio.com
RewriteCond %{HTTP_HOST} !^www\.atdbio\.com$
RewriteRule ^(.*)$ http://www.atdbio.com/$1 [R=permanent,NC]
# For CakePHP
RewriteCond %{HTTP_HOST} ^www\.atdbio\.com$
RewriteRule ^(.*)$ app/webroot/$1 [NC]
</IfModule>
I also have a separate CakePHP app in a subdirectory: tbgroup. Here is the .htaccess file (tbgroup/.htaccess):
<IfModule mod_rewrite.c>
RewriteEngine on
# For CakePHP
RewriteRule ^(.*)$ app/webroot/$1 [NC]
</IfModule>
Everything works as fine: www.atdbio.co.uk is redirected to www.atdbio.com, www.atdbio.co.uk/page is redirected to www.atdbio.com/page. CakePHP works fine. The only problem is www.atdbio.co.uk/tbgroup is not redirected to www.atdbio.com/tbgroup - it remains as www.atbio.co.uk/tbgroup (and CakePHP works fine).
Try it out on the live site if you like (www.atdbio.com or www.atdbio.co.uk).