Create an Alias Directory inside a Virtual Host
Virtual Directory / Alias Directory
Note, if you are creating an Alias to a directory outside of your DocumentRoot, you may need to explicitly permit access to the target directory:
ServerName apps.ptrl
DocumentRoot "C:/Wamp/vhosts/ptrl/apps"
ErrorLog "logs/apps-ptrl-error.log"
CustomLog "logs/apps-ptrl-access.log" common
# Puts here, before Directory directive :)
Alias /blog "C:/Wamp/vhosts/ptrl/praveen-kumar/blog"
<Directory "C:/Wamp/vhosts/ptrl/apps">
allow from all
order allow,deny
AllowOverride All
Note, too, that URL-path (first Alias part) is case-sensitive even on case-insensitive file systems.
Too, check permissions from "C:/Wamp/vhosts/ptrl/praveen-kumar/blog" directory.
Apache mod_alias
To be able to create a virtual directory, an Apache module named mod_alias must be loaded. To ensure that, we can open the httpd.conf file and look for lines like this.
LoadModule alias_module modules/mod_alias.so
Ex-2:
<VirtualHost *:80>
DocumentRoot "E:\xampplite\htdocs\r3nza"
ServerName r3nza.localhost
Alias /blog "E:\xampplite\htdocs\r3nza\blog"
SetEnv APPLICATION_ENV "development"
<Directory "E:\xampplite\htdocs\r3nza">
#Options Indexes MultiViews FollowSymLinks
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>