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
1
vote
1 answer
Change the document root for any domain to its own subdirectory
I am trying to create an .htaccess file that will change the document root of a domain to a subfolder on my server without actually changing the url to the end user. Here is an example of what I am trying to do:
domain1.com will look for web…

Tom
- 1,223
- 1
- 16
- 27
1
vote
1 answer
Apache more document roots similar to php include_path
I have more applications that differs with URL prefixes. I can set it by "Alias" directive in httpd.conf. But I'd like to use some common files like javascripts and css files (jquery, fusioncharts, images etc.) without any prefix. For PHP files I…

Hink
- 1,054
- 1
- 15
- 31
1
vote
0 answers
Server gives 301 HTTP without a reason
I have a site http://test.site.com with /var/www/html configured as a DocumentRoot. Previous website needed APC cache to be enabled. I needed to migrate new website into the same folder. Steps were as follows:
mv /var/www/html…

djtester
- 63
- 4
1
vote
0 answers
Amazon S3 Index.html over https
I setup an S3 bucket named www-example-com which contains an index.html file. The bucket is configured as "Enable website hosting" with an "Index Document" named index.html
I'm able to get the index.html file working by using
…

Bernie Lenz
- 1,967
- 23
- 45
1
vote
1 answer
PHP links working in local host but breaking when hosting application on web server
I have web application. i am using WAMP server.
I have developed web application and put my application files under "login" and then in "www" folder of wamp.i.e. Drive:\wamp\www\login\
now when upload my file to the web host that goes directly to…

The_Amol
- 309
- 3
- 15
1
vote
0 answers
stock passwords outside document root
In order to protect the passwords that I use to connect to mysql and to an smtp server, I thought of putting those passwords in a json file outside the document root and to run in the document root a json_decode();
Is this a safe solution? Or is it…

thiebo
- 1,339
- 1
- 17
- 37
1
vote
2 answers
zend framework under document root in subdir
I developed a application with Zend Framework and now I want to be able to place the app in an subdirectory of a Documentroot.
e.g. http://www.example.com/myapp/
I read quite a lot of Docu how this could work, but all in all these solutions don´t…

evildead
- 4,607
- 4
- 25
- 49
1
vote
3 answers
How do I change the DocumentRoot in AMPPS?
I recently installed AMPPS and I am trying to change the document root to different location without success. I even tried to do it in a folder inside the original path /Applications/AMPPS/www/test without success as well. I did restart apache after…

orbitory
- 1,090
- 5
- 16
- 40
1
vote
1 answer
virtual hosts always opend as localhost
I try to set up a virtual host on my ubuntu system. But it always opens the default DocumentRoot instead of the declared root.
/etc/apache2/sites-available/falkdev.conf:
ServerName falk.dev
ServerAdmin mail@falk-roeder.de
…

Falk
- 621
- 2
- 9
- 23
1
vote
1 answer
Serve web pages from directory other than /var/www
I want my web pages to be served from my server's root directory (/root/.sage) instead of /var/www .
I am using Apache Tomcat as server on Ubuntu.
Could anyone please let me know all the steps involved.

apurv
- 83
- 1
- 2
- 5
1
vote
0 answers
Apache - forbidden 403 error - when different document root
I've been having this issue for a while now. Never got to fixing it. Basically whenever I have a DocumentRoot which is not in
/var/www
I get a
Forbidden
You don't have permission to access / on this server.
Apache/2.4.7…

Prakash Raman
- 13,319
- 27
- 82
- 132
1
vote
1 answer
How to make home directory the root with useradd on Debian
I want to add a new user on a Debian server but I need to set, that it sees the home directory to be the root for security purposes.
e.g.:
new user: usr home directory: /home/usr root directory: /home/usr and it should not be able to go back to…

WolfyD
- 865
- 3
- 14
- 29
1
vote
0 answers
including files with $_SERVER['DOCUMENT_ROOT'] on localhost
I just moved my site to my local computer(a mac) but the site is not able to load properly because the include files doesn't seem to be able to include properly.
say eg:
I have the following lines:…

Lawrence
- 717
- 1
- 12
- 25
1
vote
3 answers
Fat-Free Framework mod rewrite doesn't work
I am trying to run a php project with Fat-Free Framework on MAMP, running on Yosemite 10.10.1.
I have all the project files in MAMP web root folder "htdocs" and all the fatfree project files are located within a fatfree-master dir.
The specific dir…

geokara1322
- 60
- 1
- 9
1
vote
1 answer
Retrieve the request's document root from a module
I am currently trying to develop a small Apache module which needs to retrieve the request's document root (as defined in the server configuration).
I had a look at httpd.h to see if I could find this information somewhere in the data structures…

John WH Smith
- 2,743
- 1
- 21
- 31