Hi all, I've been given a lighttpd.conf that someone else wrote and need help working out how to serve it. I'm 90% of the way there but stuck... The index.html page appears, but links and CSS files don't point to the right place.
To clarify, the links and CSS files are all pointing to a 'file:///' URL. So styles.css
in the HTML header points to file:///html/styles.css
, whereas it should be going to http://example.com/styles.css
Maybe url.rewrite or url.redirect isn't working properly?
server.document-root = "~/html"
server.port = 28001
mimetype.assign = (
".html" => "text/html",
".txt" => "text/plain",
".jpg" => "image/jpeg",
".png" => "image/png"
)
url.rewrite = (
"^(.*)/($|\?.*)" => "$1/index.html",
"^(.*)/([^.?]+)($|\?.*)$" => "$1/$2.html"
)
$HTTP["scheme"] == "http" {
url.redirect = (
"^/platform/index.html$" => "/platform",
"^/about/company.html$" => "/about/company",,
)
}
----- UPDATE ------
file:///
problem now solved, thanks to Marcel. However, http://example.com/about/company still doesn't find anything, whereas http://example.com/about/company.html renders OK. Is there a problem with url.rewrite? I'm using v1.4.20 of lighttpd, so maybe I need to change it to rewrite-once or rewrite-final?