HomeCoding & Programming

How to check whether mod_rewrite module is enabled or not in apache

Like Tweet Pin it Share Share Email

How to check whether mod_rewrite module is enabled/loaded or not in Apache

 

There are lots of techniques to check this but below is very simple technique to check whether mod_rewrite module is enabled or not in you web server.

 

1) Create a file, Type <?php echo phpinfo(); ?> in that file and save it and run that file.

 

2) You can now see the list of all information related to configuration and settings, you need to search the word “mod_rewrite” from the browser’s search.

 

3) If you found this under the “Loaded Modules” section then this module is already loaded, otherwise you need to enable mod_rewrite module if you want to use .htaccess file to write some rewrite rules (SEO friendly URLs, 301 redirect etc.).

Apache mod_rewrite

 

Enable mod_rewrite module in Apache in xampp.

1) Find the “httpd.conf” file under the “conf” folder inside the Apache’s installation folder.
e.g. D:\xampp\apache\conf\httpd.conf

 

2) Find the following line in httpd.conf file.

“#LoadModule rewrite_module modules/mod_rewrite.so”
You can do this easily by searching the keyword “mod_rewrite”.

 

3) Remove the “#” at the starting of the line, “#” represents that line is commented (module is disabled).

 

4) Now restart the Apache server.

 

5) You can see now “mod_rewrite” will show under the Loaded Module section, if you run “phpinfo()” file.