As I work on many projects and experiments on my local windows development environment (XAMPP), I normally put all web stuff in the htdocs directory and usually I’m happy with it. For several projects (like CMS installations or experiments with frameworks) it’s very handy to have a separated virtual host in order to be able to have an own document root for that application. You just don’t have to bug with different paths and subdirectories and can focus on developing instead of setting base URLs etc.

For example, if I develop MVC applications which are meant to run in a host’s document root, I want to work with paths like http://<host>/<controller>/<action> without having to deal with subdirectories like http://<host>/directory/subdirectory/public/<controller>/<action>.
It just facilitates developing and even tough it’s a little more work at setting up a new project, usually it’s worth it. Here’s a quick and dirty how to achieve this in two steps.

(more…)