Apache rewrite url help, add string in the middle of the url

64 views Asked by At

I need some help with my apache rewrites since I am quite bad at it. I want to make an apache rewrite rule where I can rewrite links from my old site format to the new one.

http://foo.bar/old/$1 to http://foo.bar/new/$1. This should also work when old is a random string or empty.

Thanks in advance.

1

There are 1 answers

0
wouter On

If anyone has the same issue as i did, i found the solution: RedirectMatch 301 ^/([-0-9a-zA-Z])/(.)$ http://foo.bar/new/$2