$DOCUMENT_ROOT and mod_userdir

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Frederik Himpe

    $DOCUMENT_ROOT and mod_userdir

    When you publish a website in /home/username/public_html and make it
    availabe with the mod_userdir apache module, it can be accessed via
    http://server/~username/. In that case though, the $DOCUMENT_ROOT
    variable is still e.g. /var/www/html. Is there another variable or a trick
    to get /home/username/public_html instead?

    Frederik

    --
    Browse securily and fast with the Mozilla Firefox web browser

  • Alvaro G. Vicario

    #2
    Re: $DOCUMENT_ROOT and mod_userdir

    *** Frederik Himpe escribió/wrote (Wed, 22 Sep 2004 15:24:18 GMT):[color=blue]
    > When you publish a website in /home/username/public_html and make it
    > availabe with the mod_userdir apache module, it can be accessed via
    > http://server/~username/. In that case though, the $DOCUMENT_ROOT
    > variable is still e.g. /var/www/html. Is there another variable or a trick
    > to get /home/username/public_html instead?[/color]

    Maybe playing around with $_SERVER['PHP_SELF'] and basedir().

    --
    -+ Álvaro G. Vicario - Burgos, Spain
    +- http://www.demogracia.com (la web de humor barnizada para la intemperie)
    ++ Las dudas informáticas recibidas por correo irán directas a la papelera
    -+ I'm not a free help desk, please don't e-mail me your questions
    --

    Comment

    • Simon Stienen

      #3
      Re: $DOCUMENT_ROOT and mod_userdir

      Frederik Himpe <see@reply.to.i nvalid> wrote:[color=blue]
      > When you publish a website in /home/username/public_html and make it
      > availabe with the mod_userdir apache module, it can be accessed via
      > http://server/~username/. In that case though, the $DOCUMENT_ROOT
      > variable is still e.g. /var/www/html. Is there another variable or a trick
      > to get /home/username/public_html instead?
      >
      > Frederik[/color]

      Apache transmits DOCUMENT_ROOT as environmental variable (sp?) to PHP, so
      maybe you can override it using SetEnv?

      --
      Simon Stienen <http://dangerouscat.ne t> <http://slashlife.de>
      »What you do in this world is a matter of no consequence,
      The question is, what can you make people believe that you have done.«
      -- Sherlock Holmes in "A Study in Scarlet" by Sir Arthur Conan Doyle

      Comment

      Working...