Lighttpd 301 Redirects

Creating search engine friendly 301 redirects as part of your SEO initiatives is a great tip to keep under your belt.

If your website server is powered by Lighttpd, generating the redirect from the config is probably your easiest and most efficient solution.

Search engines interpret the 301 code as meaning "moved permanently". In turn, PageRank/trust is passed from the old page to the new.

ShareThis

Example Code

Redirecting a Domain

$HTTP["host"] =~ "^domain\.com$" {
url.redirect = (
"^/(.*)" => "http://www.domain.com/$1",
)
}

Redirecting a Page

$HTTP["host"] =~ "^domain\.com$" {
url.redirect = (
"/old-page.html" => "http://www.domain.com/new-page.html"
)
}

This code is placed in the lighttpd.conf file on your server.


blog comments powered by Disqus



Friends