Cpanel 的所有控制器 return 404 免除 SiteController actionIndex
All controllers return 404 of Cpanel excempt SiteController actionIndex
我将我所有的网络文件夹上传到根目录
然后将我所有的项目移动到一个文件夹中
并修复了主要 index.php
中的所有地址
一切正常,但我不知道为什么会这样
但是:
class SiteController extends Controller
{
public function actionIndex()
{
return $this->render('index');
}
public function actionTest()
{
echo 'awdaw';
}
|
但站点索引工作正常
我在我的 htaccess 文件中找到了解决方案,最后我的 .htaccess 变成了这个,现在没问题了
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteCond %{HTTP_HOST} ^(www\.)?myaxagent\.com
RewriteRule ^(.*)$ https://www.mysitetesttest.com/ [R,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php [L]
请检查您的 htaccess 文件并尝试使用 controller/action 调用。在您的情况下,它将是 site/test
我将我所有的网络文件夹上传到根目录 然后将我所有的项目移动到一个文件夹中 并修复了主要 index.php
中的所有地址一切正常,但我不知道为什么会这样
但是:
class SiteController extends Controller
{
public function actionIndex()
{
return $this->render('index');
}
public function actionTest()
{
echo 'awdaw';
}
|
但站点索引工作正常
我在我的 htaccess 文件中找到了解决方案,最后我的 .htaccess 变成了这个,现在没问题了
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteCond %{HTTP_HOST} ^(www\.)?myaxagent\.com
RewriteRule ^(.*)$ https://www.mysitetesttest.com/ [R,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php [L]
请检查您的 htaccess 文件并尝试使用 controller/action 调用。在您的情况下,它将是 site/test