Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache 设置Zend骨架的重写规则_Apache_.htaccess_Zend Framework2_Virtualhost_Opensuse - Fatal编程技术网

Apache 设置Zend骨架的重写规则

Apache 设置Zend骨架的重写规则,apache,.htaccess,zend-framework2,virtualhost,opensuse,Apache,.htaccess,Zend Framework2,Virtualhost,Opensuse,我使用opensuse 12.2操作系统、apache 2.2、zend framework 2。 为了拥有框架的框架应用程序,我在apache文件中设置了一个虚拟主机。 这里是定义 <VirtualHost 127.0.0.1> DocumentRoot "/home/gabriele/Web/zf2-tutorial/public/" ServerName zf2-tutorial.localhost SetEnv APPLICAT

我使用opensuse 12.2操作系统、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/test1234,我会看到一个在框架内重定向的错误,而不是一个正常的apache错误

对于初学者,您的VHOST设置不正确:

  AllowOverride All
  DirectoryIndex index.php 
  AllowOverride None # WRONG - remove this.

您已取消覆盖,这将终止您的htaccess。

添加vhost后是否重新启动了apache?
  AllowOverride All
  DirectoryIndex index.php 
  AllowOverride None # WRONG - remove this.