-1

I have the following redirect rule:

        rewrite ^/path1/(.+)$ /path1/index.php?/$1 last;
        rewrite ^/path2/(.+)$ /path2/index.php?/$1 last;
        rewrite ^/path3/(.+)$ /path3/index.php?/$1 last;
        rewrite ^/path4/(.+)$ /path4/index.php?/$1 last;
        rewrite ^/path5/(.+)$ /path5/index.php?/$1 last;
        rewrite ^/path6/(.+)$ /path6/index.php?/$1 last;
        rewrite ^/path7/(.+)$ /path7/index.php?/$1 last;
        rewrite ^/path8/(.+)$ /path8/index.php?/$1 last;
        rewrite ^/path9/(.+)$ /path9/index.php?/$1 last;

The path is just a sample, but the real redirect has different names at the path.

There's a more generic rule to catch only this situation with 2 level paths?

Thank you for your time in checking. :-)

ayr-ton
  • 103
  • 3

1 Answers1

2

Based on your information I would recommend you to try the following rule:

rewrite ^/(.+)/(.+)$ /$1/index.php?/$2 last;

Every () is a group that can be reached by a variable.

ayr-ton
  • 103
  • 3