Questions tagged [document-root]

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

341 questions
1
vote
1 answer

Apache rewrite empty regex (root)

I've got Apache 2.4.4 running on Windows 8 laptop (WAMP server) and I found a really odd behavior of .htaccess mod_rewrite rules. I want to redirect the root of my website to a specific file. My .htaccess looks like this: RewriteEngine…
koubic
  • 597
  • 1
  • 11
  • 23
1
vote
1 answer

Apache 2.4, PHP 5.5.16 on Mint 17 - Module error

There appears to be a bug with the newest version of PHP and it's associated packages from DotDeb and the latest version of Apache 2.4 available on Mint. PHP 5.5.9, available through the default Mint packages works fine. No errors, and I can get…
Major Productions
  • 5,914
  • 13
  • 70
  • 149
1
vote
1 answer

Why use DOCUMENT_ROOT instead of defining the required path?

Just a thought but it occurred to me that when I wanted to define the document root for a website that I could use the $_SERVER['DOCUMENT_ROOT'] and it works fine on a live host. Then I thought why not just use a…
kappicraig
  • 11
  • 3
1
vote
1 answer

Redirect to internal web-directory

I already found this script to "change the documentroot": RewriteEngine on RewriteCond %{HTTP_HOST} ^your-domain-name.com$ [NC,OR] RewriteCond %{HTTP_HOST} ^www.your-domain-name.com$ RewriteCond %{REQUEST_URI} !new-folder/ RewriteRule (.*)…
user3292653
  • 602
  • 1
  • 7
  • 25
1
vote
1 answer

How to access the directories outside the subdomain folder

How do I access a folder outside my subdomain folder. For example, my domain is localhost and I have a subdomain m.localhost. And their folders are: Server Root: /cdn/ /contents/ /mobile/ .htaccess And the folder /mobile/ is the…
KevinT.
  • 272
  • 6
  • 16
1
vote
4 answers

Virtual Document Root For Many Community Sites

I think I have a weird/complicated situation but I think I'm overlooking something simple. We are setting up a Yii application that will host other "skins" people set up. It's basically one big community but on many different sites. Everything will…
Eric
  • 186
  • 1
  • 10
1
vote
3 answers

PHP - Smarter Files Referencing

I have some simple PHP scripts that helps me with small tasks on each of my servers. I run it via the CLI only, since not all my servers have Apache, but I install PHP on all. I'd like to make it portable, at any time. Here's my scripting…
coffeemonitor
  • 12,780
  • 34
  • 99
  • 149
1
vote
2 answers

How can i get SERVER['DOCUMENT_ROOT'] in prestashop tpl page

Can any one help me? I need document_root variable value in tpl page. I am using presta shop as framework. Is there any way to get it?
user3247499
  • 13
  • 1
  • 3
1
vote
1 answer

Absolute/relative paths: Root discrepancy between PHP and HTML

I am currently trying to integrate my phpBB installation into a custom CMS I'm building. phpBB relies on a variable named $phpbb_root_path in many of its functions, which works both behind the scenes (for inclusion of other PHPs etc) as well as…
ividyon
  • 656
  • 2
  • 6
  • 17
1
vote
1 answer

XAMPP server document root for specific website

I just installed XAMPP, and I've found how to change the document root in the Apache config file, but I only want to change it for a specific site. The reason I need this is because all of my links are absolute links (i.e. /url not just url). I…
David
  • 4,744
  • 5
  • 33
  • 64
1
vote
2 answers

Using PHP's $_SERVER["DOCUMENT_ROOT"] under an open_basedir restriction

I've spent the past few months building a website on localhost. Throughout the site, instead of using relative paths, I used $_SERVER["DOCUMENT_ROOT"] to access the root of my server so I could reference files from there. However, I just decided to…
Nickersoft
  • 684
  • 1
  • 12
  • 30
1
vote
1 answer

Apache trying to load from DocumentRoot instead of Alias directory

I have set up my DocumentRoot to be, let's say, X. Also, I have an Alias /web pointing to directory Y. I can load the homepage at /web without any issue. But for any other page in the same website as the homepage of /web, Apache tries to load it…
Jago
  • 2,751
  • 4
  • 27
  • 41
1
vote
0 answers

Form Submit + PHP Server Variables Changes Page Absolute Urls - htmlspecialchars($_SERVER['REQUEST_URI'])

I have a PHP config file which defined server environment vars to be use throughout the site. I'm a little perplex on why my config settings aren't working after a form submission using "htmlspecialchars($_SERVER['REQUEST_URI'])". The form…
Helen
  • 21
  • 4
1
vote
0 answers

Cannot change apache document root

Someone configured centos server for me. In httpd.conf I found: DocumentRoot "/var/www/hmtl" Under html folder there is another folder named "analysis". I put test1.html in /html folder and test2.html in /analysis folder. Now if I browse…
synergetic
  • 7,756
  • 8
  • 65
  • 106
1
vote
1 answer

Apache 2.2 multiple VirtualHosts

I have several PHP and python projects running under apache 2.2. In my httpd.conf file: DocumentRoot "/var/www/html" NameVirtualHost xx.my.ip.xxx:80 ... # Virtual host for xx project ... DocumentRoot…
johann
  • 1,115
  • 8
  • 34
  • 60