Linux Apache Rewrite模块配置

1、找相应apache版本的 mod_rewrite.so,如果没有,就重新编译一个(在其他机器上找相同apache版本)放在apache 的 modules目录下

2、apache配置文件httpd.conf中添加LoadModule rewrite_module modules/mod_rewrite.so

3、重启apache,phpinfo中有mod_rewrite,说明rewrite模块已经加载成功

4、如果网站的重写还有错误,就查看httpd.conf中配置的visualhost中该站点的重写规则是否配置正确,如果没有重写规则就查看AllowOverride 选项是否为All,如果是None就改为All,然后查看网站Documentroot下的.htaccess文件是否存在或者配置正确(.htaccess文件在linux下是隐藏文件)