i need some help while migrating an old shopsystem from apache to nginx.
Within apache there was no need to do anything. i guess the shopsystem was somehow optimized to handle those URLs. I dont have any mod_rewrite rules doing some magic. However what i need to do is rewriting urls in a certain pattern
desired behaviour:
Replace 1st / after Filename ending with (.php) with ?
Replace 2nd / with =
Replace 3rd / with &
Replace 4th / with =
[repeat 3/4] as long as there are parameters inside the URL
example urls:
http://www.shop.de/login.php/action/process
should rewrite to => http://www.shop.de/login.php?action=process
OR
http://www.shop.de/product_info.php/info/p283_foo-bar.html/action/add_product
should rewrite to ==> http://www.shop.de/product_info.php?info=p283_foo--bar.html&action=add_product
i want to keep the URL as it is, just doing some internal rewrite.
Any kind of help is apprreciated!
2
Answers
http://www.shop.de/login.php/action/process
should rewrite to
http://www.shop.de/login.php?action=process
For my products I have a rewrite like this:
An url looks like