开发者

Getting rid of index.php in the URL when using recess framework and lighttpd

I am using the recess php framework with lighttpd

Does anyone know how I can use the shorter urls of:

http://www.myserver.com/recess

Instead of:

http://www.myserver.com/index.php/recess

The recess readme file says that if I have mod_开发者_Python百科rewrite I can use the shorter url:

-- "Do you have mod_rewrite?

-- Yes: Open your browser to the location you unzipped

-- No: Open your browser to the location you unzipped followed by index.php"

I do have mod_rewrite enabled on lighttpd and i have removed the index.php but I get a 404.

Do I need any special rules in my lighttpd.conf?


Check if the relevant page from CakePHP documentation can help you. There's a section on how to setup lighttpd and prettify URLs.


To hide index.php from urls, you may want to some re-write rules something like this:

RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]


thanks all for your comments, I got the rewrite rules working (yes they are completely different to apache ones) based on cakephp docs. But still got errors in the recess framework. so switched to cakephp due to it directly supporting and being tested on lighttpd.


actually, apache's mod-rewrote has nothing to do with index.php
it's another apache directive - DirectoryIndex responsibility. But as you're using another web-server, not a popular one, you have to consult your web-server documentation for this.
I think you have to turn PHP support on first

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜