Devaki Darshini
Devaki Darshini

Reputation: 55

Moving to new site with different url structure

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

Answers (1)

hjpotter92
hjpotter92

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

Related Questions