I am coming from IIS and setting up virtual directories there is so pleasantly easy. You just right-click and add a "virtual directory" pointing to any path you like. This relative path gets reflected through the browser when viewing the site.

How do I accomplish the same thing with Apache? Symlinks scare me because deleting cascades through. Is there a better way to create virtual directories in Apache? I am using MAMP for Mac which uses apache2.

link|improve this question

69% accept rate
feedback

1 Answer

Use the Alias directive in the Apache configuration file.

Alias /virtual-dir /var/www/foo

Additionally, rm -r does not traverse symlinks and will not cascade through.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.