views:

114

answers:

4

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_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?

A: 

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]
Sarfraz
I doubt apache's mod-rewrite rules would work with this web-server
Col. Shrapnel
why down vote???????????
Sarfraz
@Col. Shrapnel: of course that is true but what is the point of the down vote?
Sarfraz
dunno it wasn't me
Col. Shrapnel
another down vote !! any explanation would be highly appreciated.
Sarfraz
I think Sarfraz is correct that I need the rewrite rules, just converted to lighttpd syntax and put in lighttpd.conf instead of .htaccess (coz lighttpd doesnt use apache .htaccess.
DEzra
Please could someone post the converted rewrite rules using lighttpd url.rewrite-once syntax?
DEzra
A: 

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

Col. Shrapnel
Yes, I am using lighttpd (in Q title and question).
DEzra
+1  A: 

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

Anax
A: 

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.

DEzra