lighttpd : rewrite-if-not-file inopérant après rewrite
Bonjour,
je ne comprends pas pourquoi cette configuration ne fonctionne pas (j'obtiens une erreur 404) quand la page d'accueil n'existe pas.
voici la configuration
bla bla
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| server.port = 80
server.document-root = "/srv/http"
server.modules += ( "mod_rewrite", "mod_redirect", "mod_simple_vhost", "mod_cgi" )
dir-listing.activate = "enable"
index-file.names = ("index.html")
mimetype.assign = (
".html" => "text/html",
".txt" => "text/plain",
".css" => "text/css",
".js" => "application/x-javascript",
".jpg" => "image/jpeg",
".jpeg" => "image/jpeg",
".gif" => "image/gif",
".png" => "image/png",
"" => "application/octet-stream",
)
server.modules += (
"mod_accesslog",
)
accesslog.filename = "/var/log/lighttpd/access.log"
server.errorlog = "/var/log/lighttpd/error.log"
simple-vhost.server-root = "/srv/http/vhosts"
simple-vhost.default-host = "home"
simple-vhost.document-root = "/"
if $HTTP["url"] =~ "^(/~[^/]+)?/cgi-bin/" {
cgi.assign = (
"" => "",
)
} |
les redirections
Code:
1 2 3 4 5 6
| url.rewrite = (
"^/$" => "/cgi-bin/accueil" # ça, ça fonctionne : qd j'appelle "http://home" ou "http://untel.home", ça va sur "<url>/cgi-bin/accueil"
)
url.rewrite-if-not-file = (
"/cgi-bin/accueil$" => "/index.html" #là, ça mârch'pô : pour telautre qui n'a pas de répertoire "/cgi-bin", j'obtiens "404 not found" au lieu d'aller sur sa page "index.html"
) |
edit: il n'y a que lorsque je demande explicitement telautre.home/cgi-bin/accueil que le redirection opère vers telautre.home/index.html /edit
bla bla vhosts
Code:
1 2 3 4 5 6 7
| $HTTP["host"] == "untel.home" {
server.document-root = "/srv/http/vhosts/untel.home"
}
$HTTP["host"] == "telautre.home" {
server.document-root = "/srv/http/vhosts/telautre.home"
} |