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
AHMED ELKHAYYAT
https://elkhayyat.me

I am a very keen individual that enjoys developing Python Programming Language. I have always loved computers and technology, ever since childhood. A team player who loves to work with other people on innovative projects and to take on challenges as an opportunity to grow as an individual in both a professional and personal capacity.

Leave a Reply

Select your currency
USD United States (US) dollar