However could anyone offer any advice as to how I can ensure that anyone entering www.domain.co.uk or www.domain.co.uk/whatever/ into the browser is redirected to www.domain.com or www.domain.com/whatever/ instead.
I was advised to add the following my server httpd.conf file
<VirtualHost 111.111.111.111>
Servername www.domain.com
ServerAlias www.domain.co.uk domain.co.uk
</VirtualHost>
This works fine if you try and access the site without a trailing slash e.g www.domain.co.uk/folder redirects to www.domain.com/folder However if you add a trailing slash e.g www.domain.co.uk/folder/ then the redirect doesn't happen.
I have also tried adding the following instead:
<VirtualHost 111.11.111.111>
Servername www.domain.co.uk
ServerAlias www.domain.co.uk
RedirectPermanent / [domain.com...]
</VirtualHost>
In this instance if you enter www.domain.co.uk you are successfully redirected if you enter anything else e.g www.domain.co.uk/folder then you get a 404.
Any help much appreciated.