所有控制器都返回404的Cpanel免税SiteController actionIndex

问题描述

我将所有Web文件夹上载到根目录 然后将我所有的项目移到文件夹中 并固定了主要index.PHP中的所有地址

一切正常,但我不知道发生这种情况的原因

this is 404 of Cpanel not me

但是:

    class SiteController extends Controller
    {
           public function actionIndex()
    {
        return $this->render('index');
    }
    
  public function actiontest()
    {
        echo 'awdaw';
    }

|

但是网站索引可以正常工作

enter image description here

解决方法

我最终在.htaccess文件中的htaccess文件中找到了解决方案,现在可以了

RewriteEngine On 
RewriteCond %{SERVER_PORT} 80
RewriteCond %{HTTP_HOST} ^(www\.)?myaxagent\.com
RewriteRule ^(.*)$ https://www.mysitetesttest.com/$1 [R,L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php [L]
,

请检查您的htacess文件,然后尝试使用控制器/操作进行调用。在您的情况下,它将是网站/测试