Reputation: 55
I want to redirect my olddomain to newdomain.right now we use below htaccess
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !newdomain.com$ [NC]
RewriteRule ^(.*)$ http://newdomain.com/$1 [L,R=301]
Except below url structure
olddomain.com/blog/intro/.... must redirect to newdomain.com/intro/....
Upvotes: 1
Views: 18
Reputation: 80649
As already stated in comment:
RewriteEngine On
RewriteRule %{HTTP_HOST} !newdomain.com$ [NC]
RewriteRule ^blog/intro/(.*)$ http://newdomain.com/intro/$1 [R=301,L]
RewriteCond %{HTTP_HOST} !newdomain.com$ [NC]
RewriteRule ^(.*)$ http://newdomain.com/$1 [L,R=301]
Upvotes: 1