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