Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/246.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
Php yii项目,在另一个yii项目内?_Php_.htaccess_Yii - Fatal编程技术网

Php yii项目,在另一个yii项目内?

Php yii项目,在另一个yii项目内?,php,.htaccess,yii,Php,.htaccess,Yii,我的项目结构如下: /var/www/html/ /protected /yii /.htaccess ... /assets /secondProject /proetected /.htaccess

我的项目结构如下:

/var/www/html/
             /protected
             /yii
             /.htaccess
             ...
            /assets
            /secondProject 
                           /proetected
                           /.htaccess
                           ....
                           /assests
secondProject不工作,当我从secondProject调用控制器操作时,我得到:

   <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
   <html><head>
   <title>404 Not Found</title>
    </head><body>
     <h1>Not Found</h1>
     <p>The requested URL /call/index.php was not found on this server.</p> 
   </body></html>
html文件夹中的和.htaccess是:

     RewriteEngine on
    RewriteBase /secondProject
    # if a directory or a file exists, use it directly
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

     # otherwise forward it to index.php
    RewriteRule . index.php
   RewriteEngine on
   RewriteBase /secondProject
   # if a directory or a file exists, use it directly
   RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

   # otherwise forward it to index.php
   RewriteRule . index.php

我应该更改什么才能使其正常工作???谢谢

您可以在根项目的
.htaccess
文件中的规则之前使用此选项

RewriteRule ^(secondProject)($|/) - [L]

您可以在根项目的
.htaccess
文件中的规则之前使用此选项

RewriteRule ^(secondProject)($|/) - [L]

为什么需要嵌套项目?您始终可以将模块用于单独的C/M/V部件。@Justinas我希望我的一个项目可以像www.xyz.com和第二个项目www.xyz.com/secondproject那样工作。我怎么做?为什么需要嵌套项目?您始终可以将模块用于单独的C/M/V部件。@Justinas我希望我的一个项目可以像www.xyz.com和第二个项目www.xyz.com/secondproject那样工作。我怎样才能做到?