Test if the Apache Mod_Rewrite module is enabled

Patches and other information
Post Reply
steven
Posts: 133
Joined: Sun Oct 01, 2017 3:08 pm

Test if the Apache Mod_Rewrite module is enabled

Post by steven »

To determine if Mod_Rewrites are enabled, you can add the RewriteRule below to your existing htaccess file immediately after RewriteEngine On or you can create another htaccess file with the code below. (Be sure to rename your old htaccess file first)

Code: Select all

RewriteEngine On
RewriteRule ^.*$ test_mod_rewrite.php
Second create a file named test_mod_rewrite.php in the same folder as the .htaccess file, you just created, and place the following code in the file:

Code: Select all

<?php echo "Apache Mod_rewrite is enabled!"; ?>
Enter your URL and if you see the Mod_rewrite message, rewrites are enabled. Don't forget to comment out the RewriteRule or change back to your original htaccess file after the test.

You can download the test files below but don't overwrite your original htaccess file.

test_mod_rewrite.zip
(806 Bytes) Downloaded 838 times


Note: the download version of test_mod_rewrite.php has additional inline CSS formatting to look a little fancier but has been W3C verified.
Post Reply