Redirect from server root directory to apache root directory

I have made simple http server on Ubuntu 14.04 with LAMP and put my html, php and js files to apache root directory /var/www/. All paths within these files are absolute and looks like /script1.php or /subdir/script.php. Directory tree of web server looks like:

/ |---var |---www |---script1.php |---subdir |---usr |---home |---etc

File /etc/apache2/sites-available/000-default.conf:

ServerAdmin [email protected] DocumentRoot /var/www <Directory /> Options Indexes FollowSymLinks AllowOverride All Order Allow,Deny Allow from all </Directory> Alias /data /var/www/ <Location /data> DAV On AuthType Digest AuthName "webdav" AuthUserFile /usr/local/apache2/.digest_passwd.dav Require valid-user Order Allow,Deny Allow from all DirectoryIndex disabled </Location> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined

The problem is in the point that all paths begin from root server directory.

for example, php command opendir('/') shows list:

/ |---var |---usr |---home |---etc

but I need list like that

/ |---subdir |---script1.php

So, how can I make Apache think that '/' means not root web server directory, but root apache directory?

Category:php Time:2018-12-19 Views:2

Related post

Copyright (C) pcaskme.com, All Rights Reserved.

processed in 0.921 (s). 13 q(s)