今天首先是网站打不开,显示的是服务器apache内部错误.500.说让检查一下服务器错误日志.
基于Debian的Linux中,系统范围的Apache错误日志默认位置是/var/log/apache2/error.log
查看之下错误信息是
[Sun Apr 24 20:56:29.411246 2016] [core:alert] [pid 14671] [client 59.33.44.215:4077] /var/www/keruiya/.htaccess: Invalid command ‘RewriteEngine’, perhaps misspelled or defined by a module not included in the server configuration
然后百度之得知是
RewriteEngine命令需要rewrite mod的支持,
解决方法
$>cd /etc/apache2/mods-enabled 切换到apache下的mods-enabled目录 $>sudo ln -s ../mods-available/rewrite.load rewrite.load 启用rewrite mod $>sudo /etc/init.d/apache2 restart 重启apache服务器。 或者在apache的配置文件httpd.conf中将#LoadModule rewrite_module modules/mod_rewrite.so前的#去掉,再重启服务器。
原创文章,转载请注明: 转载自URl-team
本文链接地址: 解决.htaccess: Invalid command ‘RewriteEngine’,问题