: Redirecting a Preview DNS subdomain to a domain with htaccess I want to redirect all the WordPress urls of the form http://example.com.previewdns.com/my-favorite-post/ to http://example.com/my-favorite-post/
I want to redirect all the WordPress urls of the form
example.com.previewdns.com/my-favorite-post/ to
example.com/my-favorite-post/
I am trying to do this with the below .htaccess code.. But its not working
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^example.com.previewdns.com$ [NC]
RewriteRule ^(.*)$ example.com/ [L,R=301]
Please help
More posts by @Candy875
1 Comments
Sorted by latest first Latest Oldest Best
Try this...
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^example.com.previewdns.com$ [NC]
RewriteRule ^(.*)$ example.com/ [L,R=301]
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.