How to test if mod_rewrite is enabled and working

Problem:
Many CMS and Blogs need mod_rewrite. However the usual user is not able to debug the problem if the pre-configured .htaccess is not working as expected.


Solution:
Write a simple .htaccess to find out if mod_rewrite is even working for your root webdirectory: Create a file .htaccess with followig content:

RewriteEngine On
RewriteRule ^i1.html$ /i2.html

Create two more testfiles:
echo "1" >i1.html
echo "2" >i2.html

If you fire up your browser with
http://yourdomain/i1.html
and you see “1” mod_rewrite is not working. If you see “2” then mod_rewrite is working fine and you do not have to bugger your hoster to check if mod_rewrite ist doing its job 😉