Bug #2164
closedcannot get alias.url working
Description
lighttpd-1.4.22 (ubuntu)
i want to redirect all requests to www.xxx.com/media to /some/abs/path
is this what alias.url is for? i cant make it out from the docs which, in part, explain its functionality like this:
"/content_x1/" is mapped to "/dirtocontent/_x1", "/content/" -> "/dirtocontent/" and "/content/somefile" -> "/dirtocontent//somefile" (yes, double slash).
i'll hold myself back and just say i dont get it.
ignoring that, im assuming it has similar functionality to apache aliases.
heres my host:
$HTTP["host"] == "www.clearerspace.com" { #server.document-root = "/.domains/clearerspace.com/www/" fastcgi.server = ( "/clearerspace.fcgi" => ( "main" => ( "socket" => "/home/x/business/clearerspace/root/.domains/clearerspace.com/www/clearerspace.sock", "check-local" => "disable", ) ), ) alias.url = ("/media" => "/home/x/business/clearerspace/root/.domains/clearerspace.com/www/public/") url.rewrite-once = ( "^(/media.*)$" => "$1", "^/favicon\.ico$" => "/media/favicon.ico", "^(/.*)$" => "/clearerspace.fcgi$1", ) }
i also have this (among other things) in the main config:
server.modules = ( "mod_access", "mod_alias", "mod_redirect", "mod_compress", "mod_evhost", "mod_rewrite", "mod_fastcgi", "mod_accesslog", ) var.basedir = "/home/x/business/clearerspace/root" server.document-root = basedir
i have tried countless variations. only setting the doc-root in vhost and viceversa.
everything else works great. but no alias media=>public
heres some output from debug.log-request-handling = "enable"
2010-02-14 23:26:48: (log.c.97) server started 2010-02-14 23:26:55: (response.c.221) -- splitting Request-URI 2010-02-14 23:26:55: (response.c.222) Request-URI : /media/index.html 2010-02-14 23:26:55: (response.c.223) URI-scheme : http 2010-02-14 23:26:55: (response.c.224) URI-authority: www.clearerspace.com 2010-02-14 23:26:55: (response.c.225) URI-path : /media/index.html 2010-02-14 23:26:55: (response.c.226) URI-query : 2010-02-14 23:26:55: (response.c.221) -- splitting Request-URI 2010-02-14 23:26:55: (response.c.222) Request-URI : /media/index.html 2010-02-14 23:26:55: (response.c.223) URI-scheme : http 2010-02-14 23:26:55: (response.c.224) URI-authority: www.clearerspace.com 2010-02-14 23:26:55: (response.c.225) URI-path : /media/index.html 2010-02-14 23:26:55: (response.c.226) URI-query : 2010-02-14 23:26:55: (response.c.276) -- sanatising URI 2010-02-14 23:26:55: (response.c.277) URI-path : /media/index.html 2010-02-14 23:26:55: (mod_access.c.135) -- mod_access_uri_handler called 2010-02-14 23:26:55: (response.c.391) -- before doc_root 2010-02-14 23:26:55: (response.c.392) Doc-Root : /home/x/business/clearerspace/root 2010-02-14 23:26:55: (response.c.393) Rel-Path : /media/index.html 2010-02-14 23:26:55: (response.c.394) Path : 2010-02-14 23:26:55: (response.c.442) -- after doc_root 2010-02-14 23:26:55: (response.c.443) Doc-Root : /home/x/business/clearerspace/root/.domains/clearerspace.com/www/ 2010-02-14 23:26:55: (response.c.444) Rel-Path : /media/index.html 2010-02-14 23:26:55: (response.c.445) Path : /home/x/business/clearerspace/root/.domains/clearerspace.com/www/media/index.html 2010-02-14 23:26:55: (response.c.462) -- logical -> physical 2010-02-14 23:26:55: (response.c.463) Doc-Root : /home/x/business/clearerspace/root/.domains/clearerspace.com/www/ 2010-02-14 23:26:55: (response.c.464) Rel-Path : /media/index.html 2010-02-14 23:26:55: (response.c.465) Path : /home/x/business/clearerspace/root/.domains/clearerspace.com/www/media/index.html 2010-02-14 23:26:55: (response.c.482) -- handling physical path 2010-02-14 23:26:55: (response.c.483) Path : /home/x/business/clearerspace/root/.domains/clearerspace.com/www/media/index.html 2010-02-14 23:26:55: (response.c.539) -- file not found 2010-02-14 23:26:55: (response.c.540) Path : /home/x/business/clearerspace/root/.domains/clearerspace.com/www/media/index.html
Updated by kinweirdo about 15 years ago
after discovering some firefox caching issues, it seems to be mostly working. however, i can only get to the aliased dir (public) if the request has a trailing slash (www.blah.com/media/) otherwise the request gets passed to fcgi.
perhaps theres a magical regex to solve this problem. any ideas?
Updated by kinweirdo about 15 years ago
ok. i finally got to the bottom of this. thank god for andy balaam.
i agree with him and other posters that this is a bad design decision. i dont actually understand it but it should never have taken me 2 frickin days to get this working.
Updated by stbuehler about 15 years ago
- Project changed from spawn-fcgi to Lighttpd
Updated by stbuehler about 15 years ago
- Status changed from New to Invalid
- Missing in 1.5.x set to No
This is neither a support forum nor is this a "spawn-fcgi" bug.
Also available in: Atom