Mapping urls to filesystem locations which is not under the document root
Apache server mapping filesystem locations:
There is no need for you to put all your files under htdocs. It will easy for you to have your files in any directory and access it using apache alias module. Just use the following lines to map the server to your required location.
The directives contained in this module allow for manipulation and control of URLs as requests arrive at the server. The Alias and ScriptAlias directives are used to map between URLs and filesystem paths. This allows for content which is not directly under the DocumentRoot to be served as part of the web document tree. The ScriptAlias directive has the additional effect of marking the target directory as containing only CGI scripts.
For eg if you want your url http://localhost/e/ to map to your directory E: which is not the document root,
* Open httpd.conf file.("C:/Program Files/xampp/apache/conf/httpd.conf")
* Search for the following line,
# Alias: Maps web paths into filesystem paths and is used to
# access content that does not live under the DocumentRoot.
# Alias /webpath /full/filesystem/path
* After the line add your alias as,
Alias /e "E:"
* Then copy the code,
Allow from all
* Paste the code after the above and change it to,
Options Indexes FollowSymLinks +Includes ExecCGI
Allow from all
* Now restart apache.
* Open your browser and type "http://localhost/e/". It will list all the contents inside the folder "E:"