Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect mod_rewrite without apache_get_modules()?

Is it possible to detect mod_rewrite in PHP when function apache_get_modules() is not available?

like image 356
Tom Pažourek Avatar asked Jun 09 '26 13:06

Tom Pažourek


1 Answers

You could analyze the output of phpinfo():

ob_start();
phpinfo(INFO_MODULES);
$contents = ob_get_contents();
ob_end_clean();
var_dump(strpos($contents, 'mod_rewrite') !== false);
like image 149
Gumbo Avatar answered Jun 11 '26 02:06

Gumbo