Created
November 7, 2010 01:36
-
-
Save havvg/665879 to your computer and use it in GitHub Desktop.
lighttpd symfony configuration w/ file existence lookup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server.modules += ("mod_rewrite", "mod_magnet") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$HTTP["host"] =~ "(^|\.)your-domain\.com$" { | |
server.document-root = "/var/www/your-domain.com/web" | |
server.errorlog = "/var/log/lighttpd/your-domain.com/error.log" | |
accesslog.filename = "/var/log/lighttpd/your-domain.com/access.log" | |
include "symfony.conf" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
attr = lighty.stat(lighty.env['physical.path']) | |
if (not attr) then | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
url.rewrite-once = ( | |
"^/(.*)\.(.*)" => "$0", | |
"^/([^.]+)$" => "/index.php/$1", | |
"^/$" => "/index.php" | |
) | |
magnet.attract-physical-path-to = ( "/etc/lighttpd/rewrite.lua" ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As of lighttpd 1.4.x the existence file lookup is simpler with
url.rewrite-if-not-file