Apologies if this sounds like clarified elsewhere. I'd searching with this on here, but I am quite confused so I am not 100% what to find to begin with.

I've got a Wordpress site that is at exampledomain.com. I additionally own exampledomain.co.uk, and that i have make the .htaccess file the follow lines:

RewriteCond %{http_host} ^exampledomain.co.uk [nc]
RewriteRule ^(.*)$ http://exampledomain.com/$1 [r=301,nc]

These work fine when it comes to altering exampledomain.co.uk to exampledomain.com, however the moment I include something after the exampledomain.co.uk (i.e. exampledomain.co.uk/page1) the .htaccess file does not change it out therefore it attempts to load.

Can there be something I'm able to increase the .htaccess file that will sort this, to ensure that, for instance, basically would type exampledomain.co.uk/page1 it might redirect to exampledomain.com/page1 ?

Thanks,

Charlie

P.S. Apologise for that strangely parsed example links, but like a new user it will not allow me to include a lot more than two hyperlinks.

Why don't you function

RedirectPermanent / http://exampledomain.com

within the co.uk's config rather? mod_rewrite is extremely handy, however for an easy domain redirector, it's major overkill.


comment followup:

I'd choose something similar to this:

RewriteCond %{HTTP_HOST} exampledomain.co.uk$ [NC]
RewriteRule (.*) http://exampledomain.com/$1 [R=301,L]