apache - .htaccess question - redirects after the domain name -


apologies if answered elsewhere. had search on here, i'm quite confused i'm not 100% search in first place.

i have wordpress site @ exampledomain.com. own exampledomain.co.uk, , have put in .htaccess file follow lines:

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

these work fine in terms of changing exampledomain.co.uk exampledomain.com, moment add in after exampledomain.co.uk (i.e. exampledomain.co.uk/page1) .htaccess file doesn't change tries load.

is there can add .htaccess file sort this, that, example, if type exampledomain.co.uk/page1 redirect exampledomain.com/page1 ?

thanks,

charlie

p.s. apologise weirdly parsed example links, new user won't let me include more 2 hyperlinks.

why not

redirectpermanent / http://exampledomain.com 

in co.uk's config instead? mod_rewrite handy, simple domain redirector, it's major overkill.


comment followup:

i'd go this:

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

Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -