How to check whether mod_rewrite is enable on server?

Usually cpanel(WHM) compiles mod_rewrite by default. You can check with this:

root@server [~]# httpd -l|grep rewrite

So you must just activate it in your ‘.htaccess’ using:

RewriteEngine On

To check if mod_rewrite module is enabaled, create a new php file in your root folder of your WAMP server. Enter the following


Access your created file from your browser.

Ctrl+F to open a search. Search for ‘mod_rewrite’. If it is enabled you see it as ‘Loaded Modules’

If not, open httpd.conf (Apache Config file) and look for the following line.

#LoadModule rewrite_module modules/

remove the pound (‘#’) sign at the start and save the this file.

Restart your apache server.

Access the same php file in your browser.

search for ‘mod_rewrite’ again. You should be able to find it now.

For Plesk Servers

Log into your server via ssh as root.

Mod Rewrite is enabled by default on plesk servers. You can verify this with the following command:

# apachectl -M | grep rewrite

modify the vhost.conf file at /var/www/vhosts/

# replace "AllowOverride None" with "AllowOverride all".

restart apache with the following command:

service httpd restart

Create a .htaccess containing the following and upload it to the root of your site:

RewriteEngine On
RewriteRule ^google.html$ [R=301]

Going to should redirect you to if you have mod rewrite enabled and your syntax is correct.

For more information on Mod rewrite see the following links.

Leave a Comment

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.