Project

General

Profile

Feature #2475

[PATCH] Allow files to be used as document-root

Added by wsl about 3 years ago. Updated over 2 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
Start date:
2013-02-15
Due date:
% Done:

100%

Estimated time:
1.00 h
Missing in 1.5.x:
No

Description

A very convenient feature of Apache is that you can set a file as your document root, effectively allowing you to route all requests to a single .php file (with the path as path_info).

Note that this is functionally different from using mod_rewrite, as PATH_TRANSLATED and PHP_SELF will have different values. This means that in the case of mod_rewrite, PHP will think it was loaded using /index.php (and will use this as the base for constructing self-urls) whereas with a file as document-root PHP_SELF is "/" and php will be able to deduce the actual URL that was used.

More convenient and more correct. The patch is a single change (a >= instead of a >).

file-as-docroot.patch View (628 Bytes) wsl, 2013-02-15 13:05

Associated revisions

Revision 9cfc080a (diff)
Added by stbuehler over 2 years ago

[core] allow files to be used as document-root (fixes #2475)

From: Stefan Bühler <>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2900 152afb58-edef-0310-8abb-c4023f1b3aa9

Revision 2900 (diff)
Added by stbuehler over 2 years ago

[core] allow files to be used as document-root (fixes #2475)

From: Stefan Bühler <>

History

#1 Updated by stbuehler almost 3 years ago

  • Target version set to 1.4.x

#2 Updated by stbuehler almost 3 years ago

  • Target version changed from 1.4.x to 1.4.33

#3 Updated by stbuehler over 2 years ago

simple workaround:

alias.url = ("" => server.document-root )

#4 Updated by stbuehler over 2 years ago

  • Status changed from New to Fixed
  • % Done changed from 0 to 100

Applied in changeset r2900.

Also available in: Atom