How To Set Up mod_rewrite for Apache on CentOS 7

If you want to allow mod_rewrite for apache on CentOS 7 just follow these steps:

1- Edit httpd.conf file by:

sudo nano /etc/httpd/conf/httpd.conf

2- Search for this line:

<Directory /var/www/html>

3- Search for this AllowOverride inside the above Directory and set it to:

AllowOverride All

4- Restart the Apache service by using this command:

sudo systemctl restart httpd

5- Create .htaccess file in the web directory /var/www/html/ and enable RewriteMode by:

RewriteEngine On

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Select your currency
USD United States (US) dollar