Tag Archive ‘lighttpd’

 

CharlyBr on Jul 22nd, 2008Maintenance mode (HTTP 503) with lighttpd and PHP

When you put your website in maintenance mode, it’s a good idea to return a HTTP 503 error code to the client.
This code indicates that “the server is currently unable to handle the request due to a temporary overloading or maintenance of the server”.
The 503 code is used to avoid crawlers or [...]

CharlyBr on Jun 30th, 2008Permanent redirect (301) with lighttpd

If you want to redirect visitors that access your website without the ‘www’, you can use mod_redirect with the following syntax:
$HTTP[”host”] =~ “^lescampeurs\.org” {
url.redirect = (
”^/(.*)$” => “http://www.lescampeurs.org/$1″
)
}

Links:

Lighttpd mod_redirect
HTTP 3xx status codes

CharlyBr on May 28th, 2008Deny access to .svn directories with Apache2 / lighttpd

If you’re using SVN to control your web application, your certainly need to deny access to .svn sub-directories.
With Apache2
<DirectoryMatch “^/.*/\.svn/”>
Order allow,deny
Deny from all
</DirectoryMatch>
With [...]

CharlyBr on May 6th, 2008Use mod_redirect with lighttpd

Enable mod_redirect
server.modules += ( “mod_redirect” )
Force your domain with www.
$HTTP["host"] =~ “^domain\.com$” {
url.redirect = ( “^/(.*)” => “http://www.domain.com/$1″ )
}
Force your domain without www.
$HTTP["host"] =~ “^www\.domain\.com$” {
url.redirect = ( “^/(.*)” => “http://domain.com/$1″ )
}
Redirect HTTP requests to HTTPS
$SERVER["socket"] == “:80″ {
$HTTP["host"] =~ “(.*)” {
[...]