日期:2014-05-16  浏览次数:20750 次

ubuntu apache .htaccess 500错误500 internal error with RewriteEngine on
系统ubuntu 14.04
原因apache配置没有载入rewrite模块,ubuntu中apache的配置模块和配置虚拟主机是通过a2ensite a2enmod命令,不是直接去修改apache的配置,间接修改apache的配置实现的....这两个命令的详细解释自行man

解决sudo a2enmod rewrite
sudo service apache2 restart

我是从zf2配置.htaccess中遇到这样的问题

后记

确认ubuntu上rewrite模块是否安装: ls /etc/apache2/mods-available | grep rewrite
rewrite.load 有这个文件,默认都有安装

确认apache配置是否载入 rewrite  ls /etc/apache2/mods-enabled | grep rewrite
rewrite.load 有这个文件表示已经载入配置

参考:http://stackoverflow.com/questions/19718919/500-internal-error-with-rewriteengine-on-htaccess-on-localhost-with-wamp

https://www.digitalocean.com/community/articles/how-to-set-up-apache-virtual-hosts-on-ubuntu-12-04-lts