Ubuntu 下rewrite 无法启动

Rico_2012 2013-10-09 06:35:49
最近在学zendframework2
用的是ubuntu 12.04 做服务器
/etc/apache2/sites-available/下建立zend 文件如下

NameVirtualHost *:80
<VirtualHost *:80>
ServerName www.zend.local

DocumentRoot /opt/htdocs/zf2/public

SetEnv APPLICATION_ENV "development"

<Directory /opt/htdocs/zf2/public>
DirectoryIndex index.php

AllowOverride All

Order allow,deny

Allow from all
</Directory>
</VirtualHost>


zendframework/public/.htaccess文件如下:

RewriteEngine On
# The following rule tells Apache that if the requested filename
# exists, simply serve it.
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
# The following rewrites all other queries to index.php. The
# condition ensures that if you are using Apache aliases to do
# mass virtual hosting, the base path will be prepended to
# allow proper resolution of the index.php file; it will work
# in non-aliased environments as well, providing a safe, one-size
# fits all solution.
RewriteCond %{REQUEST_URI}::$1 ^(/.+)(.+)::\2$
RewriteRule ^(.*) - [E=BASE:%1]
RewriteRule ^(.*)$ %{ENV:BASE}index.php [NC,L]

该文件是由 github自动生成的
然后我把/etc/apache2/sites-available/default,/etc/apache2/sites-available/default-ssl里的AllowOverride None 全改成 AllowOverride All了
实际运行zendframework,首页没问题,但访问别的目录无法跳转到index,请问是什么原因?有遇到同样的问题的吗? rewrite模块确认已开启,实在找不到是哪里的问题
...全文
117 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

4,250

社区成员

发帖
与我相关
我的任务
社区描述
国内外优秀PHP框架讨论学习
社区管理员
  • Framework
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧