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
.htaccess 如何在live server上设置ZF2_.htaccess_Installation_Zend Framework2 - Fatal编程技术网

.htaccess 如何在live server上设置ZF2

.htaccess 如何在live server上设置ZF2,.htaccess,installation,zend-framework2,.htaccess,Installation,Zend Framework2,我有一个问题,我应该将框架文件夹放在live server上的什么位置?这是我在Zend Framework 2中的第一个应用程序。在本地主机上,一切似乎都很好,我想在live server上测试它,但我感到困惑 home home/username home/username/public_html 我用Zend的公用文件夹复制的.htaccess将所有内容放在公共html中。因此,我的结构如下所示: home/ home/username/ home/u

我有一个问题,我应该将框架文件夹放在live server上的什么位置?这是我在Zend Framework 2中的第一个应用程序。在本地主机上,一切似乎都很好,我想在live server上测试它,但我感到困惑

 home
   home/username
     home/username/public_html
我用Zend的公用文件夹复制的.htaccess将所有内容放在公共html中。因此,我的结构如下所示:

 home/
   home/username/
     home/username/public_html/
       config/
       data/
       module/
       public/
       vendor/
       .htaccess
       init_autoloader.php
但是我无法在
www.mydomain.com/
中访问我的应用程序,我必须使用
www.mydomain.com/public
我认为问题出在.htaccess上,因此它是:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteCond %{REQUEST_URI}::$1 ^(/.+)(.+)::\2$
RewriteRule ^(.*) - [E=BASE:%1]
RewriteRule ^(.*)$ %{ENV:BASE}index.php [NC,L]
php_flag eaccelerator.enable 0
php_flag eaccelerator.optimizer 0 
我尝试添加
RewriteRule^(.*)$/public/index.php[NC,L]
,但没有改变任何东西。 它是live server上正确的应用程序结构吗?

我应该将供应商文件夹保存在哪里?

我通常将我的应用程序克隆到/home/username/application,并将/home/username/public\u html符号链接到application/public

您的供应商文件夹位置很好