Wamp Alias Directories
I use Wamp Server together with NetBeans to develop PHP applications on my local machine. This works well because I can do debugging (thanks to xdebug) and can readily view and edit files. I usually don’t like to place projects in the c:\wamp\www folder, preferring instead to place them in more logical places in my personal directory.
The easiest way to facilitate this is to create Apache aliases to these different locations. Wamp Server provides an interface for creating new aliases by clicking on the tray icon and selecting Apache -> Alias directories -> Add an alias. A new command prompt window opens where you can enter the alias information.
Creating an alias like this, you’ll probably notice that in order for the URL to work, you have to have a trailing slash at the end (e.g. http://localhost/example/ will work while http://localhost/example won’t). This can be a bit of a pain, but there is fortunately a quick fix. Click on the Wamp Server tray icon again and select Apache -> Alias directories -> [alias url] -> Edit alias. This will open the alias file in Notepad. Remove the trailing slash from the relative URL.
For Example
Alias /example/ "c:/path/to/example/"
Would become
Alias /example "c:/path/to/example/"
Save the file and close Notepad. Wamp Server should restart automatically (if not, you can restart it manually from the tray icon). Once it has restarted, you’re alias should now work with or without the trailing slash. Why Wamp Server doesn’t do this automatically, I’m not sure, but at least there’s a simple fix.
Thanks for this tip. I figured out the alias but thought it didn’t work because of that extra slash at the end.
Thanks!