3 回答

TA貢獻1846條經(jīng)驗 獲得超7個贊
apache_get_modules()
mod_rewrite
in_array('mod_rewrite', apache_get_modules());
strpos(shell_exec('/usr/local/apache/bin/apachectl -l'), 'mod_rewrite') !== false
true
mod_write

TA貢獻1797條經(jīng)驗 獲得超6個贊
復制這段代碼并運行以找出答案。
<?php
if(!function_exists('apache_get_modules') ){ phpinfo(); exit; }
$res = 'Module Unavailable';
if(in_array('mod_rewrite',apache_get_modules()))
$res = 'Module Available';
?>
<html>
<head>
<title>A mod_rewrite availability check !</title></head>
<body>
<p><?php echo apache_get_version(),"</p><p>mod_rewrite $res"; ?></p>
</body>
</html>

TA貢獻1780條經(jīng)驗 獲得超5個贊
### .htaccess<IfModule mod_rewrite.c> # Tell PHP that the mod_rewrite module is ENABLED. SetEnv HTTP_MOD_REWRITE On RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # The rest of your rewrite rules here</IfModule>
array_key_exists('HTTP_MOD_REWRITE', $_SERVER);
- 3 回答
- 0 關(guān)注
- 445 瀏覽
添加回答
舉報