我使用opensuse 12.2 os、apache 2.2、zend framework 2。为了拥有框架的骨架应用程序,我在apache的文件中设置了一个虚拟主机。这是定义
<VirtualHost 127.0.0.1>
DocumentRoot "/home/gabriele/Web/zf2-tutorial/public/"
ServerName zf2-tutorial.localhost
SetEnv APPLICATION_ENV "development"
<Directory "/home/gabriele/Web/zf2-tutorial/public/">
Options +FollowSymLinks
AllowOverride All
DirectoryIndex index.php
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
当我移动到 zf2-tutorial.localhost 时,我可以看到欢迎页面。我试过htaccess
Options +FollowSymlinks
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]
RewriteRule ^.*$ index.php [NC,L]
The structure of my folder is :
\home
\gabriele
\Web
\zf2-tutorial
\public
-index.php
-htaccess
如果我继续 zf2-tutorial.localhost/test1234 我应该看到一个错误重定向到骨架内,而不是我看到一个正常的 apache 错误。