I am seeing a strange behavior when accessing $_SERVER['DOCUMENT_ROOT']
on a subdomain. It contains a duplicate folder name which does not exist.
Here is the the relevant output of $_SERVER
:
[DOCUMENT_ROOT] => /var/www/sub.domainname.com/sub.domainname.com
[SCRIPT_FILENAME] => /var/www/sub.domainname.com/index.php
It should be:
[DOCUMENT_ROOT] => /var/www/sub.domainname.com
Here is the virtual host configuration:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName sub.domainname.com
DocumentRoot /var/www/sub.domainname.com
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/sub.domainname.com>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>