I have a website with two domain names pointing to it (.com and .co.uk). I want all links to be to the .com domain for SEO purposes.
I've done this before and used htaccess rewrite rules to do it:
RewriteCond %{HTTP_HOST} !^www.fred.com$ [NC]
RewriteRule ^(.*)$ http://www.fred.com/$1 [L,R=301]However this also affects subdirectories, and in this particular case I have a subdirectory that holds a forum, and this forum has been accessed via the .co.uk domain (http://www.fred.co.uk/forum/).I don't know if that can be addressed by htaccess rules (which also have to cater for friendly URLs)
It occured to me one way round this might be to make the URL generation in index.php always generate the .com form of the urls, in which case only the initial page would exist in both .com and .co.uk forms, and all internal links within the site would always be .com.
Is this:
1) sensible
2) easy.
(fred.co.uk/forum really doesn't like being called as fred.com/forum and won't actually log you in. It accepts user id and password, validates them, and then dumps you back to the login page. It uses phpbb.)
Any suggestions welcome












