I want to map
https://www.example.com/Something/SomethingElse/
to
https://www.example.com/index.php?/Something/SomethingElse/
So far I understood that I need the location
directive in nginx and use the try_files
inside, something like this:
location ~ *???* {
try_files $uri $uri/ /index.php?$1;
}
Now, the question is: how do I write the regular expression *???*
to split URL, so I get the /Something/SomethingElse/
back (into $1
)? Is it possible?
Perhaps, there is an easier way? nginx variable?