Test if the Apache Mod_Rewrite module is enabled
Posted: Thu Feb 15, 2018 9:42 pm
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)
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:
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.
Note: the download version of test_mod_rewrite.php has additional inline CSS formatting to look a little fancier but has been W3C verified.
Code: Select all
RewriteEngine On
RewriteRule ^.*$ test_mod_rewrite.php
Code: Select all
<?php echo "Apache Mod_rewrite is enabled!"; ?>
You can download the test files below but don't overwrite your original htaccess file.
Note: the download version of test_mod_rewrite.php has additional inline CSS formatting to look a little fancier but has been W3C verified.