Linux

Ubuntu’s Apache makes it so easy to enable modules via a2enmod. You can enable mod_rewrite by just typing:

a2enmod mod_rewrite

RHEL’s story is quite different. Enabling mod_rewrite on RHEL could be enabled by modifying the configuration. Apache’s configuration is located at: /etc/httpd/conf/httpd.conf.

Enabling mod rewrite would be enabled when we change the configuration. The original configuration would have AllowOverride None:

<Directory "/var/www/html">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

A modification can be done by changing AllowOverride None to AllowOverride All

<Directory "/var/www/html">
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

Restart

Apache should be restarted to enable configurations.

sudo service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]

Voila! Profit!