在网上搜索了一下,有人说是权限问题
<Directory "项目路径">
Options Indexes FollowSymLinks +Includes
AllowOverride None
Order allow,deny
Allow from all
</Directory>
增加上面的allow from all就行了。尝试了一下,还是不行。
突然想到,去看看apache错误日志提示什么错误,打开error.log,错误如下:
Permission denied: /home/work/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
google了一下,有人回复:
Is the file & directory readable by the web daemon? .htaccess should be chmod'ed to 777, and the directory it's in will need to be readable by the user the httpd runs as.
看了httpd.conf配置,
User daemon
Group users
于是修改为
User work
Group users
重启apache,OK了。