I need to permanently redirect all www.domain.com to domain.com in Lighttpd.
Here's relevant part of my lighttpd.conf:
$HTTP["host"] =~ "^www\.domain\.com$" {
url.redirect = (
"^/(.*)" => "http://domain.com/$1"
)
}
$HTTP["host"] =~ "(^|\.)domain\.com$" {
...
url.rewrite-once = (
...
"^(/.*)$" => "/mysite.fcgi$1",
)
}
Problem is that all URLs like http://www.domain.com/blah/ get redirected to http://domain.com/mysite.fcgi/blah/
I need the "mysite.fcgi" rewrite rule since it sends the request to fastcgi instance.
How do I redirect properly?