我有PHP 5.3.8,Apache 2.2.21,一切都很好,除了mod_rewrite
默认情况下LoadModule rewrite_module modules/mod_rewrite.so已启用(未注释掉)
ClearModuleList不存在
AddModule mod_rewrite.c不存在
然后你有
<Directory /> Options FollowSymLinks AllowOverride All </Directory>
仍然我testingmod_rewrite,它不工作,我应该做什么? 如果它不是.htaccess我会用nginx,通过默认安装apache的方式,当我得到的VPS,然后我更新,但没有改变httpd.conf设置
你认为我应该卸载它,并重新安装它自己? 大家都说默认情况下不应该启用mod_rewrite,所以我不知道为什么我的apache是不同的
Redirect指令属于mod_alias ,而不是mod_rewrite 。
为了testingmod_rewrite ,把下面的文件放在文件根目录下的.htaccess文件中:
RewriteEngine On RewriteRule (.*) http://google.com [R=301,L]
确保您在<Directory "/document/root">设置了AllowOverride All
如果你有PHP
<?php phpinfo(); ?>
在Web浏览器中加载该页面,然后search“mod_rewrite”。 一切正常,你可以在页面的“Apache loaded modules”部分find它。
在任何RewriteRule 必须有RewriteEngine on 之前 .htaccess
RewriteRule的结构
重写规则模式replace[OptionalFlags]