John K.
John K.

Reputation: 65

URL rewrite using .htaccess (specific one)

need help rewriting URL using .htaccess file. The new website lost the word "dovanos" in URL, and I want to save my customers and seo redirecting them to correct page.

I have few thousand URL's like these:

www.example.com/dovanos/category1/item1.html

www.example.com/dovanos/category1/item2.html

www.example.com/dovanos/category2/item1.html

www.example.com/dovanos/category2/item2.html

And so on. Need to rewrite them so, that they loose word "dovanos":

www.example.com/category1/item1.html

www.example.com/category1/item2.html

www.example.com/category2/item1.html

www.example.com/category2/item2.html

Could anybody help with these? Thank you!

Upvotes: 0

Views: 55

Answers (1)

Moob
Moob

Reputation: 16184

RewriteEngine on
RewriteRule ^dovanos/(.*)\.html$ $1.html [R=301,L]

Upvotes: 1

Related Questions