Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Rewrite rules for lighttpd


Reply

9 Posts   14209 Views

Avatar
robvdl

4 June 2008 at 6:58pm (Last edited: 4 June 2008 7:09pm), Community Member, 5 Posts

I have simplified it even more, I don't know why I didn't think if this before, but the following solution fixes the problem with mixed case file extensions, .jpg, .JPEG or .JpeG are fully supported now:

$HTTP["host"] == "yoursite.com" {
server.document-root = "/home/user/public_html/"
url.rewrite-once = (
"(?i)(/.*\.([A-Za-z0-9]+))(.*?)$" => "$0",
"^/(.*?)(\?|$)(.*)" => "/sapphire/main.php?url=$1&$3"
)
server.error-handler-404 = "/sapphire/main.php"
}

Please note: the forum seems to screw up the spacing in the above code sample, please check the wiki page instead:

http://doc.silverstripe.com/doku.php?id=installation-on-lighttpd