: Rewrite cond regex to split an url with a / I'm struggling to correct the aftereffects a bogus redirect I made which led to a lot of 404s. I need to 301 redirect URLs that look like
I'm struggling to correct the aftereffects a bogus redirect I made which led to a lot of 404s.
I need to 301 redirect URLs that look like
example.com/xysometext
to
example.com/xy/sometext
the example.com/xy and example.com/xy/ parts are permanent, while sometext is unique for each page (i.e. .*)
I'm only starting to undestand mod-rewrite syntax, help much appreciated. Thanks.
More posts by @Lengel546
2 Comments
Sorted by latest first Latest Oldest Best
Try this:
RewriteCond %{REQUEST_URI} !^/xy/ [NC]
RewriteCond %{REQUEST_URI} ^/xy(.*)$ [NC]
RewriteRule .* www.example.org/xy/%1.html [R=301,L]
I think should do it. Please let me know and I can update the answer.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.