2012-10-11 20 views
1

Limonade PHP微型框架適用於Nginx。但是,我想獲得「漂亮的網址」功能,但我不知道如何。例如,我可以訪問http://a.com/?/about而沒有任何問題,但我想提供http://a.com/about如何配置Nginx的Limonade PHP微型框架?

Limonade PHP微型框架提供了一個.htacess文件來啓用Apache中的「漂亮的網址」功能,但我無法弄清楚如何用Nginx做到這一點。

我想:

location/{ rewrite ^(.*)$ /index.php?uri=/$1 break; } 

看來工作。我可以參觀http://a.com/about代替http://a.com/?/about,但服務器的響應慢得令人難以置信和框架功能url_for()不能正常工作,所以必須有一些人失蹤。

任何人都可以幫助我找到正確的方式來配置此?

回答

0

這是晚來了一點,但在框架的最新版本應該工作。在服務器{}部分將這個在nginx.conf:在這個pull request加入

try_files $uri $uri/ /index.php?$args; 

此功能。

見sloonz在獲取更多信息的討論標籤註釋。

+0

https://github.com/sofadesign/limonade/blob/master/examples/urlrewrite/nginx.conf – yangzh