I am trying to rewrite the following URL via Nginx:
http://www.domain.com/script.php?title=LONGSTRING&desc=LONGSTRING&file=LONGSTRING&id=THREELETTERS
into something like this:
http://www.domain.com/script/LONGSTRING/LONGSTRING/LONGSTRING/LONGSTRING/THREELETTERS.html
All I have been able to find so far is how to include a single variable. I have five variables to pass through, each terminated by a "/".
you can access a script parameter
name
in nginx through the $arg_name variablerewriting the url with the script parameters to an seo-friendly url then becomes a simple rewrite like so:
the reverse, rewriting the seo-friendly url to the php script version would be:
Basically you have regex captures (each round bracket pair is a capture) that you can then reference with the $1, $2, ... variables