Enabling Mod_Rewrite in Apache 2.x


Trying to enable mod_rewrite in Apache 2? Check these things.

  1. In your httpd.conf file (probably in/etc/httpd/conf/), search for the line:
    LoadModule rewrite_module modules/mod_rewrite.so
    Ensure there is no pound sign (#) in front of this line.
  2. Search for AllowOverride and ensure it is set to All.
  3. Search for AccessFileName. If you do not find a line that says:
    AccessFileName   .htaccess
    You need to add it.
  4. Restart Apache (service httpd restart OR /etc/init.d/httpd restart)

That should be it.

,

  1. #1 by Drobon Cars at May 19th, 2009

    Thanks for this helpful tips…. I’ve configured my apache and now it works….

  2. #2 by Darrin at September 13th, 2009

    Trying to do the same thing. I noticed in my httpd.conf file I have several lines that read “AllowOveride None”. Is there a specific line that should be set to All? Should I change every instance of it?
    Thanks

  3. #3 by saikat at February 3rd, 2010

    thanks it worked after adding “AccessFileName .htaccess”

    U rock man

  4. #4 by sam at July 2nd, 2010

    thanks! worked for me.

(will not be published)
  1. No trackbacks yet.