#258 URL error with user directories

0.7.0 and Prior
open
nabber00
None
5
2012-05-01
2011-02-20
Anonymous
No

I download the 0.70 files, extract them to my webserver. I go to www.myserver.com/~myuser/install00.php and it works okay, also the setup.php works fine after install06.php.
But at the end of the setup.php i press "submit". Then it takes me to the address: http://myserver.com/home/muyser/public_html/index.php which obviously is not working! Same problem is with all the links on index.php after setup is completed. It worked fine on the 2 years ago when it was last updated.....

Discussion

  • I solved this by manually editing the file scripts/config.php.
    I included this line: define('ROOT_DIR', 'd:\homepages\blog\\');
    Works with windows, at least.
    It's a simple workaround but I didn't know any php so it was quite complicated to solve this.

     
  • The ROOT_DIR definition didnt work for me on linux...
    After some little investigations I think the logic to determine the BASE_URL in the file scripts.config.php doesnt work when using mod userdir in apache :

    if ($_SERVER['SCRIPT_FILENAME'] == realpath($_SERVER['SCRIPT_FILENAME'])) {
    define('BASEURL', preg_replace("/^" . str_replace("/", "\/", $_SERVER["DOCUMENT_ROOT"]) . "/", "", ROOT_DIR));
    } else {
    define('BASEURL', '/' . basename(dirname(dirname(__file__))) . '/');
    }

    With a userdir ( vhosts ? ), the DOCUMENT_ROOT can be completely different from the dirname of the __file__ (in ROOT_DIR). Therefore the substitution logic is flawed...

    I fixed that by commenting the code pasted up there, and replacing it with:
    define('BASEURL','');

     
  • nabber00
    nabber00
    2011-03-19

    • labels: 626486 -->
    • assigned_to: nobody --> nabber00
    • summary: URL error. --> URL error with user directories
     
  • nabber00
    nabber00
    2011-11-29

    This should really just be converted to a config value that is set via the install process based on SCRIPT_NAME.

     
  • nabber00
    nabber00
    2012-05-01

    • milestone: --> 0.7.0 and Prior