Feature #2475

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

Added by wsl almost 2 years ago. Updated about 1 year ago.

Status:FixedStart date:2013-02-15
Priority:NormalDue date:
Assignee:-% Done:

100%

Category:-Estimated time:1.00 hour
Target version:1.4.33
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 Magnifier (628 Bytes) wsl, 2013-02-15 13:05

Associated revisions

Revision 2900
Added by stbuehler about 1 year ago

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

From: Stefan Bühler <>

History

#1 Updated by stbuehler over 1 year ago

  • Target version set to 1.4.x

#2 Updated by stbuehler over 1 year ago

  • Target version changed from 1.4.x to 1.4.33

#3 Updated by stbuehler about 1 year ago

simple workaround:

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

#4 Updated by stbuehler about 1 year ago

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

Applied in changeset r2900.

Also available in: Atom