php - nette, lighttpd - url rewrite? -


i new nette framework , have no experience url rewriting, apologize question.

the default syntax of nette's router is:

<presenter>/<action>[/<id>]  

so urls in format localhost/mypage/articles/view/35

my question how configure lighttpd accept these urls , bind them valid content?

i found configuration apache in documentation: http://doc.nette.org/en/2.1/troubleshooting#toc-how-to-allow-mod-rewrite

try using magnet-module + lua script

add magnet module lighttpd modules

server.modules = ( ...         "mod_magnet", ...   ) 

lighttpd virtual host example:

$http["host"] =~ "^(example.com)$" {     server.document-root = "/var/www/example.com/document_root"     magnet.attract-physical-path-to = ( server.document-root + "/rewrite.lua" ) } 

create rewrite.lua file in document_root folder (according setting above)

attr = lighty.stat(lighty.env["physical.path"]) if (not attr)     lighty.env["uri.path"] = "/index.php"     lighty.env["physical.rel-path"] = lighty.env["uri.path"]     lighty.env["physical.path"] = lighty.env["physical.doc-root"] .. lighty.env["physical.rel-path"] end -- uncomment below debug output stdout -- print ("final file " ..  lighty.env["physical.path"]) 

credit post goes 'edke' user nette forum thread

could worth trying (or inspired): http://www.guyrutenberg.com/2008/05/24/clean-urls-permalinks-for-wordpress-on-lighttpd/


Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -