Drupal: How to enable Clean URL’s if using localhost

If you can’t enable clean URL’s in Drupal when set up locally, chances are that mod rewrite is disabled. All you have to do is uncomment a line in your httpd.conf file in order to enable mod rewrite disabled. If you’re using XAMPP, it’s located at xampp\apache\conf.

Open the file in notepad or a text editor of your choice and search for the following line:
#LoadModule rewrite_module modules/mod_rewrite.so

Uncomment it by getting rid of the #.

Restart Apache and you should be able to enable clean URL’s now. In case you can’t, drop a a comment and I’ll be glad to help out.

22 Comments

  1. GLANY said on January 29, 2009 at 5:57 pm |

    I did the changes as mentioned above, but unable to restart the Apache as its showing the message
    Busy…
    error:-1

  2. Cone Trees said on January 29, 2009 at 10:26 pm |

    Glany, do a Ctrl-Alt-Del and kill the xampp-control.exe process. Then restart the Xampp control panel.

    Does this help?

  3. Izan said on February 23, 2009 at 4:55 pm |

    Thanks!!
    I have got clean urls now :D
    Thank you very much!

  4. Cone Trees said on February 23, 2009 at 7:27 pm |

    You’re welcome Izan.

  5. Tony Z said on March 1, 2009 at 5:46 am |

    Thanks! I had tried a couple of other solutions, but this is the one that finally worked.

  6. Cone Trees said on March 2, 2009 at 10:07 pm |

    Great. You’re welcome Tony.

  7. risang said on March 21, 2009 at 10:36 am |

    good share….thanks

  8. Cone Trees said on March 22, 2009 at 11:56 pm |

    Your welcome risang.

  9. Jaison said on March 23, 2009 at 9:51 pm |

    Hello Dear,
    Clean URL is activated now, thanks a lot.

    I am running it in local system and since there is no outgoing emails, it shows some alerts in pink background. How to resolve those, also its says Cron has not run.

    Thanks
    Jais

  10. Cone Trees said on March 25, 2009 at 12:07 am |

    Hi Jais

    I know what you are talking about but I haven’t used Drupal for a really long time now. I’ll try and find out and let you know if you’re still interested.

  11. Patrizio said on August 4, 2009 at 3:56 am |

    @Jaison
    u receive a mail from local installation procedure because you have not a mail-server. About the CRON: you can run it manually when you need it. It’s usefull in several cases (if u set triggers for examples, or detecting updates). It is possible also to run the CRON automatically through command line (complex stuff). Hope I was helpfull guys! Bye

  12. Mayilsamy said on November 6, 2009 at 12:04 pm |

    Hi,
    I’m using WAMP server. I locally installed drupal 6 , the clean url is not working here. I did followed your instructions. Can you help me out?..Thanx in advance.

  13. Orkhan said on January 24, 2011 at 8:02 am |

    It really worked for me.
    Thanks!

  14. Mani said on February 22, 2011 at 1:15 pm |

    Thank you

  15. Jon said on May 25, 2011 at 5:47 pm |

    Hi
    I have Drupal 6 and lamp install with Ubuntu 11.04. I copied my website down to localhost but have problems. All links return 404 Not found. If I include ?q= in the url the browser just strips it out. The site is at /var/www/presstoprint.co.uk.
    My httpd.conf (at /etc/apache2/httpd.conf) was empty, so I added
    LoadModule rewrite_module modules/mod_rewrite.so

    Running apache2ctl -M returns rewrite_module (shared)
    so I assume that it is running.

    any help much appreciated
    Jon

  16. Brijesh said on June 30, 2011 at 9:20 pm |

    Same position as Mayilsamy. Drupal 6 on Wampserver. Followed your instructions. Can’t enable Clean URLs on Drupal site as admin.

  17. vijay said on September 15, 2011 at 3:52 pm |

    Thanks for the support for clean urls in localhost

  18. senthil said on October 20, 2011 at 5:25 pm |

    Thanks it working

  19. Telmo said on February 29, 2012 at 8:52 pm |

    Muito muito obrigado!

  20. Sanjay Grover said on November 14, 2012 at 11:27 am |

    Sir where i can access Apache Server in parallel plesk 9.5.5 .i m not able to access conf. file

  21. Geoffrey said on April 10, 2013 at 5:20 am |

    That was the trick.

    4 hours in.

    Thank you!

    Tell me where to send the bitcoin tip.

  22. serg said on May 23, 2013 at 2:35 am |

    Thanks a lot! it helped - I spent the whole evening trying to solve this :)

Have something to say? Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*