我使用的是opensuse 12.2 os,apache 2.2,zend framework 2. 爲了讓框架的骨架應用程序在apache的文件中設置一個虛擬主機。 這裏是定義爲Zend Skeleton設置重寫規則
<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的錯誤錯誤。
您是否在添加虛擬主機後重新啓動apache? – Crisp 2013-04-24 14:42:25