【发布时间】:2015-06-11 18:29:16
【问题描述】:
我开始使用 nginx。在我使用 apache 之前。 并且默认它在 apache 中运行良好(AcceptPathInfo 选项):
SEO 友好的网址: http://testsite.com/anyfile.php/get_param1/get_value1/get_param2/get_value_2 ...等
结果,从 apache 文件转换后看起来: http://testsite.com/anyfile.php?get_param1=get_value1&get_param2=get_value_2 ...等
但是,怎么用nginx呢?它适用于许多和任何文件:anyfile.php、anyfile1.php、anyfile2.php 等......很多文件都使用它。
有可能吗?因为我看到了很多答案,但没有看到任何文件。
非常感谢。
【问题讨论】:
-
感谢您的回答,但它不适用于任何文件和任何数量的获取参数。例如我的决定。但它只适用于任何文件,而不适用于任何数量的 get 参数:rewrite ^/(.*\.php)/(.*)/(.*)$ /$1?$2=$3 我怎样才能添加很多获取参数? Apache 的 Nginx 等效选项:AcceptPathInfo
标签: mod-rewrite nginx