How to active sudo a2enmod rewrite for centos?

October 17, 2013 124.5k views
Following the tutorial "How To Set Up Mod_Rewrite" indicates I should run the command "sudo a2enmod rewrite", but I mark: sudo: a2enmod: command not found anyone know how to fix it?
7 Answers
Uncomment the line in /etc/httpd/conf/httpd.conf, restart apache, and you should be good to go.
Hello Kamal Nasser!

I tryed this, but still is not work . . another idea??
In httpd.conf, search for AllowOveride None and change to AllowOveride All, then restart apache.
Using .htaccess files and setting AllowOverride All is not recommended. It's better to put the rewrite commands in your Directory section in httpd.conf. To enable the rewrite engine in this context, you need to set "RewriteEngine On" and "Options FollowSymLinks" must be enabled. (From:

This is what did it for me

I am totally new at this and I am trying to fix it based on the fact that wordpress is telling me page not found errors (saw on a forum that my modrewrite must be off) So I started following this directions:
but it gave me this message

3 packages can be updated.
3 updates are security updates.

Last login: Sun Apr 12 20:49:18 2015 from

Careful, you're logged in as root! * Do not create app files or install apps as root. * Customizations may break your server.

root@KCSC:~# sudo a2enmod rewrite
sudo: a2enmod: command not found
root@KCSC:~# sudo a2enmod rewrite
sudo: a2enmod: command not found

Dunno what to do now.

by Etel Sverdlov
This tutorial goes over Mod_Rewrite, an apache module that allows you to manipulate URLS to provide shorter or more relevant ones. This tutorial will go over Activating Mod_Rewrite, Creating and Using the required .htaccess page, and setting up the URL rewrites.

is there still no install package for centos/rhel?

Hi there, it seems no way to enable it on CentOS, see this for more information:

Have another answer? Share your knowledge.