I have setup my lighttpd in a fashion which redirects all subdomains to my primary domain in following fashion * .domain.com
-> domain.com
. Unfortunately when i type in a subdomain such as www.domain.com
it goes directly to http://domain.com/site.fcgi/
and literally breaks the page. When i exclude the subdomain it opens the page perfectly.
Following lighttpd settings are used:
$HTTP["host"] =~ "\.domain\.com(:[0-9]+)?$" {
url.redirect = ("^/(.*)" => "http://domain.com/$1")
}
$HTTP["host"] =~ "^domain\.com(:[0-9]+)?$" {
server.document-root = "/var/www/servers/domain.com/awesomesite"
accesslog.filename = "/var/www/logs/domain.com/access.log"
server.errorlog = "/var/www/logs/domain.com/error.log"
fastcgi.server = (
".fcgi" => (
"main" => (
# Use host / port instead of socket for TCP fastcgi
"bin-path" => "/var/www/servers/domain.com/awesomesite/domain.fcgi",
"socket" => "/tmp/domain.sock",
"check-local" => "disable",
)
),
)
alias.url = (
"/static/" => "/var/www/servers/domain.com/awesomesite/static/",
)
url.rewrite-once = (
"^(/static.*)$" => "$1",
"^(/.*)$" => "/domain.fcgi$1",
)
}
Furthermore i have added FORCE_SCRIPT_NAME = ''
to my settings.py
.
I am not able to figure out where the problem is caused, there is nothing to come for in the log files either. Im a bit lost in no mans land.