Tom Pažourek
Tom Pažourek

Reputation: 10187

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?

Upvotes: 3

Views: 4638

Answers (1)

Gumbo
Gumbo

Reputation: 655717

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);

Upvotes: 9

Related Questions