我需要一些幫助,同時將舊的商店系統從apache遷移到nginx。 在Apache內部,不需要做任何事情。我想商店系統是以某種方式優化來處理這些網址。我沒有任何mod_rewrite規則做一些魔術。但是我需要做一定的模式被重寫URLnginx重寫規則來生成搜索引擎友好的舊網址xtcommerce 3.04 sp 2.1商店系統
所需的行爲:
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
例如網址:
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
我想保留網址,只是做一些內部重寫。
任何類型的幫助apprreciated!
例URL只是'登錄.php「,但這並不意味着這將是唯一的一個URL。您的示例在其他情況下不起作用。 – kworr