Re: htaccess
Le lundi 31 mai 2010 à 04:16:54, deny a écrit :
> ceci ne fonctionne pas :
>
> $HTTP["host"] =~ "www.linux-pour-lesnuls.com/blog/wp-admin" {
> server.document-root = "/home/deny/aide/blog/wp-admin"
> server.error-handler-404 = "/e404.php"
>
> expire.url = ( "/wp-content/" => "access plus 1 hours",
> )
>
> auth.backend = "htpasswd"
> auth.backend.htpasswd.userfile = "/home/deny/.htpasswd"
> auth.require = ( "/" =>
> (
> "method" => "basic",
> "realm" => "Access to admin interface",
> "require" => "valid-user"
> ))
> }
>
>
>
> ceci en revanche fonctionne :
>
> $HTTP["host"] =~ "www.singers-swing.com" {
> server.document-root = "/home/deny/aide/blog2"
> server.error-handler-404 = "/e404.php"
>
> expire.url = ( "/wp-content/" => "access plus 1 hours",
> "/audio/" => "access plus 1 hours",
> "/photo/" => "access plus 1 hours",
> )
>
> auth.backend = "htpasswd"
> auth.backend.htpasswd.userfile = "/home/deny/.htpasswd"
> auth.require = ( "/wp-admin/" =>
> (
> "method" => "basic",
> "realm" => "Access to admin interface",
> "require" => "valid-user"
> ))
> }
Hello.
Le truc c'est de bien distinguer $HTTP["host"] et $HTTP["url"].
Fort heureusement, il est possible depuis lighttpd 1.4.0 d'utiliser
des conditionnelles imbriquées. Du genre :
$HTTP["host"] == "host.example.com" {
$HTTP["url"] =~ "^/monurl" {
# Instructions...
}
}
De toute façon la doc est là :
http://redmine.lighttpd.net/wiki/1/Docs:Configuration
Bon courage.
Reply to: