Mod_Rewrite is an Apache module used to manipulate URL’s and is compiled into the base Apache HTTP Server in CentOS. See the mod_rewrite documentation for more information.
How to configure the Apache mod_rewrite module
- Open the Apache configuration file located at /etc/httpd/conf/httpd.conf
sudo vi /etc/httpd/conf/httpd.conf
- Change AllowOverride None to AllowOverride All inside the DocumentRoot Directory Directive, normally <Directory “/var/www/html”>
- If the root directory is different, change AllowOverride None to AllowOverride All inside the Directory Directive, normally <Directory />
- After you save and exit that file, restart apache.
sudo service httpd restart