Apache Mod Rewrite and PHP
Posted Jul 8, 2009
Last Updated Aug 13, 2013
If you need to test if an Apache server is running the mod_rewrite module
, don’t waste your time building some elaborate system or doing it manually. Learn from my mistake and do it the simple way with this PHP code:
<?php
if (in_array('mod_rewrite', apache_get_modules())) {
// Apache has Mod Rewrite
} else {
// Apache DOES NOT have Mod Rewrite
}
Thanks Andrew! Too bad I didn’t know about apache_get_modules()
until after I had built something far more complex!
- Related Topics
Andrew Penry
Jul 9, 2009
Reply