yii项目,在另一个yii项目中?

时间:2015-07-01 12:26:17

标签: php .htaccess yii

我的项目结构如下:

/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>

.htaccess of secondProject

     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
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

我需要更改什么才能使其正常工作?谢谢

1 个答案:

答案 0 :(得分:0)

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

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