【发布时间】:2013-06-04 12:13:39
【问题描述】:
Limonade PHP 微框架适用于 Nginx。但是,我想获得“漂亮的网址”功能,但我不知道如何。例如,我可以毫无问题地访问http://a.com/?/about,但我想让http://a.com/about 可用。
Limonade PHP 微框架提供了一个.htacess 文件来启用 Apache 中的“pretty url”功能,但我不知道如何使用 Nginx。
我试过了:
location / { rewrite ^(.*)$ /index.php?uri=/$1 break; }
它似乎工作。我可以访问http://a.com/about而不是http://a.com/?/about,但是服务器的响应非常慢,并且框架函数url_for()无法正常工作,所以肯定是缺少了什么。
谁能帮我找到正确的配置方法?
【问题讨论】: