Creating and Managing Apache Aliases
Recently i started to code a lot more php/html/css. So i finally installed xampp/mamp on my local machine and created Aliases that directly point to the current project folder which makes it a lot easier to test.
To create an Alias just add following code into the httpd.conf file:
Alias /myAlias /Users/username/folder/deploy <Directory "/Users/username/folder/deploy"> Options Indexes FollowSymLinks ExecCGI Includes AllowOverride All Order allow,deny Allow from all </Directory>
After restarting your apache server the alias should work right away. In our example it would be http://localhost/myAlias.
Instead of just adding those lines to the httpd.conf file you can also easily manage your aliases in external files. Save the above code in a new textfile (e.g. myAlias.conf) and include your alias-folder-path in the httpd.conf file by adding following code to it.
<IfModule mod_alias.c> Include /Applications/MAMP/conf/apache/alias </IfModule>
Make sure that your folder path is set right. From now on you can just add aliases to that folder. nice and handy.