0

I have some old URLs I want to rewrite. The URLs look like this(dsa7dasdashdas334 is an ID and can be anything):

http://test.com/dsa7dasdashdas334/123456
http://test.com/dsa7dasdashdas334/789
http://test.com/dsa7dasdashdas334
http://test.com/dsa7dasdashdas334
.
.
.
http://test.com/${id}/

Now I want all of the URLs above redirected to this URL: http://test.com/new-path/${id}/. How can I achieve this?

Right now, my redirects look like this:

rewrite ^/${id}/?$ https://$host/new-path/${id}/

  • Well, http://test.com/aaa/123456 could be http://test.com/aaa/123456/dgdhs/HJJFKSD/DSDS too. But other than this, yes – Ic3m4n Jan 13 at 6:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.