I use WAMP for my local web testing before uploading to my live server at Dreamhost. Clicking on the icon gives you a menu for common tasks, but I needed to add a few more choices.
To add extra menu choices to your WAMP menu, go into where it’s installed, and look for a file named wampmanager.tpl. Open this file in a text editor, even Notepad will do. What you’re faced with is a basic INI file structure. Pick a category, look at the other examples to go by, and add your own menu item. After saving, exit and restart WAMP. So, why did I want to modify the menu? I don’t like using localhost/folder for testing my websites. I prefer to have something like sitename.loc for my sites. The .loc is just something I made up to resemble .com or .net or what not. To set this up, you need to modify two files… the Windows Host file, and the Apache Vhost file. Wamp doesn’t have menu options for either, so I added them. Here is what they look like:
Type: item; Caption: "Windows hosts file"; Glyph: 6; Action: run; FileName: "notepad.exe"; parameters:"C:\Windows\System32\drivers\etc\hosts" Type: item; Caption: "Apache vhosts file"; Glyph: 6; Action: run; FileName: "notepad.exe"; parameters:"C:\wamp\bin\apache\Apache2.2.17\conf\extra\httpd-vhosts.conf"
If you copy my example, be careful of which Apache version you have installed.
While we’re on the topic of Virtual Hosts, let’s show an example. In the Windows Hosts file, I might add a line such as:
127.0.0.1 fuelapp.loc
In case you can’t tell, I’ve been messing with Fuel, a PHP framework. I would then open up the Apache Vhosts file, and add something like:
<VirtualHost *:80>
ServerAdmin webmaster@fuelapp.loc
DocumentRoot "C:/wamp/www/public"
ServerName fuelapp.loc
ServerAlias www.fuelapp.loc
ErrorLog "C:/wamp/www/fuel/app/logs/error.log"
CustomLog "C:/wamp/www/fuel/app/logs/access.log" common
</VirtualHost>
If you’re going by my example, just replace fuelapp with the name you want for your own site. I suggest using the same domain name as the real thing, except with the .loc extension so you know it’s just a local test version. Of course, in addition to setting up your sites to work with virtual hosts, you need to make sure the feature is even turned on in Apache. In your WAMP menu, open up httpd.conf and search for the line Include conf/extra/httpd-vhosts.conf. If there is a hash mark in front of it (there probably is on a default install of Wamp), that means it’s commented out. Delete that hash mark to uncomment it, save, and restart Apache.
If you’re messing with nearly any popular software, like WordPress and Drupal, you’re going to want to enable mod_rewrite. By default in Wamp, it’s not turned on. What is it? It’s what allows you to have pretty URLs, like example.com/about, instead of example.com/?p=123. In your WAMP menu, look for Apache > Apache modules > rewrite_module, and enable it. You may need to restart Wamp. Now your .htaccess files will work.