Redirect to new domain in Wordpress

Yet again baffled by .htaccess

I have this site :

Which I want to redirect, keeping the URLs after the domain intact to this :

I've got this in .htaccess:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^
RewriteRule (.*)$1 [R=301,L]

However it only redirects if the domain is typed in, for example, I can still go here :

When it should redirect to here :

Any ideas?
Who is Participating?
ScorchDConnect With a Mentor Commented:
This issue is explained well here, I have had to do this a few times.
Zephyr ICTCloud ArchitectCommented:
Wouldn't this be better? Can't test if it would be.

RewriteCond %{HTTP_HOST} ^ [NC]
RewriteRule ^(.*)$$1 [L,R=301]

Open in new window

Robert SaylorSenior DeveloperCommented:
Are you using SSL? This will only redirect non SSL. Another option would be to use php.
andythecalAuthor Commented:
Tried spravtek's solution but I get the same, anything outside the root path isn't redirected.

Nope - not SSL.
andythecalAuthor Commented:
Bang on! Worked a treat.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.