Clean URLs on WampServer
Many content management systems — Wordpress, Drupal, and Silverstripe come to mind — make use of “clean URLs“. This is a feature of the web server which instantly converts people and search engine friendly paths (tool.com/products/screws/) into paths for use by the application (tool.com/index.php?product=4).
On the Apache web server, the rewrite module must be enabled for clean URLs to function properly. This module is usually disabled by default. Fortunately, WampServer provides a graphical interface which makes it simple to modify Apache settings.
Ready to enable rewrite_module? Here’s how:
- Start WampServer. An icon should appear in your task bar:
WampServer icon - Click the icon to open WampServer’s main menu.
- Open the ‘Apache‘ submenu and then ‘Apache modules‘.
- Scroll down to ‘rewrite_module’ and click to enable it.
That’s all there is to it! A quick tip, but important nonetheless and something I’ve seen a lot of CMS users — myself included — get stuck on. I hope this helps.
Ah, I wish it worked here as well! I followed the steps correctly but I get this error message when trying out the clean URL page (admin/settings/clean-urls):
Bad Request
Your browser sent a request that this server could not understand.
What version of Wampserver do you use? Mine is 2.0, and I’m running it under Windows XP.
I checked the httpd.conf file, and this line is indeed uncommented, but still no dice:
LoadModule rewrite_module modules/mod_rewrite.so
I’m also using Wampserver 2.0 on Windows XP. The only thing I can think of off hand is to download the Drupal and replace your .htaccess with a fresh copy. I’d suggest posting on the Drupal.org forums as your best bet.
what you did is you just replace the .htaccess of wampserver 2.0 with that of drupals? and enable mod_rewrite??
Yes, Drupal comes with an .htaccess file which should be in your main Drupal directory. With mod_rewrite enabled (see the directions above) you should find an option to enable Clean URLs at http://yourwebsite.com/?q=admin/settings