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那样工作。我怎样才能做到?