Reputation: 102
I'm not able to get to work this 301 redirect, i have to remove "BeTa" word from all the request, and redirect:
FROM:
http://www.example.com/BeTa/other/content
TO:
http://www.example.com/other/content
"BeTa" could also be present in other part of url:
FROM:
http://www.example.com/bla/BeTa/other/content
TO:
http://www.example.com/bla/other/content
is it possible? Right now I have only tried the first part:
RewriteEngine on
RewriteRule ^/BeTa/(.*)$ /$1 [R=301,L]
thanks in advance
Upvotes: 1
Views: 2064
Reputation: 785128
You can tweak your regex to match BaTa
anywhere like this:
RewriteEngine on
RewriteRule ^(.+?/)?BeTa(?:/(.*))?$ /$1$2 [NC,R=301,L]
Upvotes: 5