Reputation: 23
I need to redirect https://www.mysite.com/folder/subfolder to https://www.mysite.com/folder/ in lighttpd. I've tried the following:
$HTTP["host"] =~ "https://www.mysite.com/folder/folder" {
url.redirect = (
".*" => "https://www.mysite.com/folder/"
)
}
but it did not work.
Can anyone please tell me the correct syntax in Lighttpd?
Thanks.
Upvotes: 2
Views: 1314
Reputation: 7558
This might be because the mod_redirect module isn't available (it's typically disabled by default).
modules.conf
server.modules = (
"mod_access",
"mod_proxy",
"mod_accesslog",
# "mod_alias",
# "mod_auth",
# "mod_evasive",
"mod_redirect",
"mod_rewrite"
# "mod_setenv",
# "mod_usertrack",
)
lightttpd.conf
$HTTP["scheme"] == "http" {
$HTTP["host"] =~ "^subdomain.server.com" {
url.redirect = (".*" => "https://%0$0")
}
}
Upvotes: 2