Questions tagged [document-root]

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

337 questions
83
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
  • 841
  • 1
  • 7
  • 6
29
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
24
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,265
  • 2
  • 16
  • 29
21
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
  • 18,175
  • 16
  • 93
  • 143
18
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
  • 6,807
  • 5
  • 51
  • 85
13
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
  • 914
  • 2
  • 7
  • 18
12
votes
4 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,574
  • 8
  • 37
  • 67
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…
9
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
  • 11,830
  • 21
  • 77
  • 115
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 =…
Remo
  • 2,160
  • 2
  • 20
  • 33
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,446
  • 2
  • 19
  • 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
  • 138,188
  • 158
  • 423
  • 589
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
6
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
  • 144,097
  • 139
  • 361
  • 489
1
2 3
22 23