The document root directory under which the current script is executing, as defined in the server's configuration file.
Questions tagged [document-root]
341 questions
90
votes
9 answers
How to change xampp localhost to another folder ( outside xampp folder)?
How can I change my default xampp localhost c:xampp/htdoc to another folder i.e. c:/alan? When I use the IP address I should be able to view my website file in C:/alan.
Thanks for helping me.

enrekan2011
- 911
- 1
- 7
- 6
31
votes
2 answers
Apache multiple DocumentRoot
How can I have the following setup in apache?
http://server/ABC/* should be served by /var/www/ABC/*
http://server/PQR/* should be served by /var/www/PQR/*
Every other request should be served by /var/www/Others/index.php (a single…
JP19
29
votes
7 answers
Where is the web server root directory in WAMP?
Also is the web server root directory the place where you put your site files and later acces them with localhost/file_name in the browser?

ionescho
- 1,360
- 2
- 17
- 31
24
votes
3 answers
select document root using jquery
I can select the body and html parts of the document using
$('body')
and
$('html')
respectively, but how do I select the document root?

tomsv
- 7,207
- 6
- 55
- 88
23
votes
3 answers
ProxyPass and DocumentRoot on one domain
Let's say I have the following configuration:
# Server names, admins, logs etc...
ProxyVia On
ProxyRequests Off
ProxyPass http://localhost:8080/tomcat-webapp/
ProxyPassReverse…

fracz
- 20,536
- 18
- 103
- 149
15
votes
5 answers
Access a file which is located before / outside the server root directory?
I'm making an intranet for a post-sale customer service entreprise. Employee need to be able to upload img files to the intranet's server and i need to store them in a directory with is BEFORE www (the website's root directory).
Doing this using php…

Weacked
- 954
- 2
- 7
- 18
14
votes
5 answers
javascript site root
I have this site that I need to find the root folder / plus the actual folder its works out of.
My problem here is that during development i have the folder with in my local server that in turn is with in its own folder:
Then online I then have the…

Simon Davies
- 3,668
- 9
- 41
- 69
12
votes
1 answer
Accessing files outside the document root with Apache
I have a project setup and i'm trying to access a file from a temp folder on the server.
The document root for the website is similar to this:
/a/b/c/d/e/f/g/h/mywebsite.com (of the letters have proper names).
The file I need to read lives…

diggersworld
- 12,770
- 24
- 84
- 119
10
votes
4 answers
Path of current PHP script relative to document root
TL;DR: What alternatives to the last code sample on this page are there when trying to use relative links on pages included with PHP's include command?
I'm trying to include() a file that links to a .css document, the problem is that I need to…

Abandoned account
- 1,855
- 2
- 16
- 22
9
votes
2 answers
What is the best way to hide a websites folder/ directory files
If I would visit my website by "www.mysite.com/img/"
I would see the following:
Parent directory...
folder1
folder2
file1
file2
etc etc..
But what is the best way to prevent people from visit my websites folders and file structure?
While still…

kevin ols
- 127
- 1
- 2
- 6
8
votes
1 answer
Lighttpd: Let sub-path point to different document root
I have a lighttpd-Setup pointing to the document-root /var/www. However, I want the URL other/ to point to /some/other/dir. This I'm doing with the following config:
$HTTP["url"] =~ "^/other($|/)" {
server.document-root =…

sudoremo
- 2,274
- 2
- 22
- 39
7
votes
4 answers
Determining a website's 'root' location
I need some help with concepts and terminology regarding website 'root' urls and directories.
Is it possible to determine a website's root, or is that an arbitrary idea, and only the actual server's root can be established?
Let's say I'm writing a…

Yarin
- 173,523
- 149
- 402
- 512
7
votes
3 answers
Best way to reference root html element with jQuery?
Which is the best way (performance-wise) to get the root document node (the element) in jQuery? I can think of several methods that may or may not work:
$("html")
$(document.documentElement)
$(document) (?)
$.root (?)
$.document (?)

dalgard
- 3,614
- 2
- 22
- 28
7
votes
5 answers
PHP: How not to hard code web application root
I currently have the following in a config file in my application:
define('DOCROOT', dirname(__FILE__).DIRECTORY_SEPARATOR);
define('WEBROOT', 'http://localhost/samples/');
The first line works perfectly. I can include the config file anywhere and…

Svish
- 152,914
- 173
- 462
- 620
7
votes
2 answers
How can I have yii protected folder outside htdocs by using Netbeans
I'm currently developing a PHP web application which uses Yii framework.
As I want to prevent direct access from web browser to some files required by Yii, I moved both framework and protected folders outside htdocs folder.
As a result, I ended up…

edilima
- 73
- 1
- 5