While you can often stick a project in a subdirectory of your htdocs and access from localhost/project, that can be inconvenient (e.g., assume leading slashes from absolute-from-root pathing, like /path/to/file.ext).

It’s simple enough to create a virtual host like http://project.local or http://project.dev.

1. Open httpd-vhosts.conf (usually in your Apache install directory, under conf/extra… note that it doesn’t have to be there, and some folks use other configuration files, but last I read this was the suggested file by Apache). Add the following node (at a minimum):

<VirtualHost *:80>
DocumentRoot "c:/path/to/your/project"
ServerName project.local

2. Open your hosts file, usually C:\Windows\System32\Drivers\etc\hosts, in any text editor. Make sure you either open it as an Administrator, or lower the security on that folder, to be able to save the changes. Add this line at the bottom:

[code] project.local

3. Restart apache.

That’s it – you can now open your browser to http://project.local and will see whatever’s in there, just as if it were in the public root of a web server. Absolute and relative links will also work as expected, in the same fashion they would on a site in a top-level domain.