Sign up ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I want to redirect all the WordPress urls of the form to

I am trying to do this with the below .htaccess code.. But its not working

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

Please help

share|improve this question

1 Answer 1

Try this...

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST}  ^example\.com\.previewdns\.com$ [NC]
RewriteRule ^(.*)$$1 [L,R=301]
share|improve this answer
Hi !Thanks for the reply. I've tried your code. It's not working! – Pramod Mar 10 '14 at 4:51
Well what happens then? What does the resulting URL look like? – zigojacko Mar 10 '14 at 9:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.