How to detect mod_rewrite without apache_get_modules()?

后端 未结 1 1413
轻奢々
轻奢々 2021-01-20 06:13

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

相关标签:
1条回答
  • 2021-01-20 06:21

    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);
    
    0 讨论(0)
提交回复
热议问题