Trying to enable mod_rewrite in Apache 2? Check these things.
- 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. - Search for
AllowOverride
and ensure it is set toAll.
- Search for
AccessFileName
. If you do not find a line that says:
AccessFileName .htaccess
You need to add it. - Restart Apache (
service httpd restart
OR/etc/init.d/httpd restart
)
That should be it.
Drobon Cars says
Thanks for this helpful tips…. I’ve configured my apache and now it works….
Darrin says
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
saikat says
thanks it worked after adding “AccessFileName .htaccess”
U rock man
sam says
thanks! worked for me.