我的项目结构如下:
/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
我需要更改什么才能使其正常工作?谢谢
答案 0 :(得分:0)
您可以在根项目的.htaccess
文件中的规则之前使用它
RewriteRule ^(secondProject)($|/) - [L]