[Solved] Redirect not redirecting
Added by theking2 about 1 year ago
With this in the lighttpd.conf file pool.ntp.org is not redirected but opens the default local server
$HTTP["host"] == "pool.ntp.org|ch.pool.ntp.org" { accesslog.filename = "/var/log/lighttpd/pool.ntp.org_access.log" $HTTP["url"] =~ "^/$" { url.redirect = ( "/" => "https://ntppool.org" ) url.redirect-code = 301 } }
shows the contents of /var/www/html/index.html not https://ntppool.org
Replies (3)
RE: Redirect not redirecting - Added by gstrauss about 1 year ago
$HTTP["host"] == "pool.ntp.org|ch.pool.ntp.org" {
should instead be$HTTP["host"] =~ "pool.ntp.org|ch.pool.ntp.org" {
since it looks like you intended a regex.
For exact match of host, I would use a more precise regex$HTTP["host"] =~ "^(?:ch\.)?pool\.ntp\.org$" {
RE: [Solved] Redirect not redirecting - Added by gstrauss about 1 year ago
You might have troubleshot this yourself using
Configuration: Debug Variablesdebug.log-condition-handling = "enable"
RE: [Solved] Redirect not redirecting - Added by gstrauss about 1 year ago
Also relevant: HowToRedirectHttpToHttps