homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

DOCUMENT ROOT on Local Server Using XAMPP

Msg#: 4604088 posted 11:08 am on Aug 22, 2013 (gmt 0)

How do I add a trailing slash to my htdocs folder (C:\xampp\htdocs)?

On my live production site I can include files like:


which works fine, but on localhost the server looks for:


I've edited the local httpd.conf file (added the trailing slash to DocumentRoot "C:/xampp/htdocs/" and <Directory "C:/xampp/htdocs/">) and tried some rewrite rules (even if I could get my head round regex, would this work anyway?) in htaccess without success.

This only affects files referenced using DOCUMENT_ROOT.


[edited by: phranque at 10:06 pm (utc) on Aug 27, 2013]
[edit reason] disabled graphic smileys [/edit]



WebmasterWorld Senior Member Top Contributors Of The Month

Msg#: 4604088 posted 5:27 am on Aug 25, 2013 (gmt 0)


That's interesting -- I've given up on "local servers" and only use production servers, but I have include($_SERVER["DOCUMENT_ROOT"].'/foo/foo.php'); on all of them, which I believe is how it should be [or at least it's been that way on every production box I can remember] and makes sense technically according to the docs.

DOCUMENT_ROOT should be:

The document root directory under which the current script is executing, as defined in the server's configuration file.


Technically /the-path/to-the-file/ is the path of the defined index file of the directory, not the path of the root directory the current file is running under.


WebmasterWorld Senior Member lucy24 us a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month

Msg#: 4604088 posted 8:12 am on Aug 25, 2013 (gmt 0)

:: detour to check my own files ::


Huh. Mine all say

include ($_SERVER['DOCUMENT_ROOT'] . "/foo/foo.php");

with leading slash. Works identically on MAMP and live server.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved