Tuesday
23
Aug 2005

Simple lighttpd config for redirecting all traffic

(8:38 am) Tags: [Software, Sysadmin]

Say you have a case where you need to redirect all traffic from one site to some other site. For example, when your site is down temporarily for maintenance.

3 little lines is all the lighttpd config you need:
server.modules = ( "mod_redirect")
server.document-root = "/www/"
url.redirect = ( "^.*$" => "http://someotherhostname/dira/dirb/" )

The stop and start lighttpd, starting with the new config file:

lighttpd -f down.conf

Popularity: 18%

Comments: (1)