1

I have a maps.conf with a lot of map blocks like

map $uri $page_redirect {
  include /etc/nginx/maps/rewrites.map;
}

...and a lot of *.map files that redirect pages, for instance:

*/homepage/* to *https://example.com*
and
*/my-page/* to *https://example.com/page/*

Now I also have some sections of the site where I need to use a variable for a more dynamic redirect.

/dynamic-page/detail/o5u48i3u5 should redirect to https://example.com/show/page/detail/o5u48i3u5

What I have tried to far was this:

~^/dynamic-page/detail/(?<location>.*)/$          https://example.com/show/page/detail/$location/;

The redirect itself works, but it won't replace $location in the URL so it looks like this: https://example.com/show/page/detail/$location/

I have even tried

~^/dynamic-page/detail/(.*)/$          https://example.com/show/page/detail/$1/;

but the URL is https://example.com/show/page/detail/$1/

Can someone point me in the right direction?

techraf
  • 4,163
  • 8
  • 27
  • 44
dmnkhhn
  • 111
  • 3

0 Answers0