3 回答
TA贡献1842条经验 获得超22个赞
apache_get_modules()mod_rewrite
in_array('mod_rewrite', apache_get_modules());strpos(shell_exec('/usr/local/apache/bin/apachectl -l'), 'mod_rewrite') !== falsetruemod_write
TA贡献1752条经验 获得超4个赞
复制这段代码并运行以找出答案。
<?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贡献1934条经验 获得超2个赞
### .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 关注
- 428 浏览
添加回答
举报
