PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, March 12, 2022

[FIXED] All controllers return 404 of Cpanel excempt SiteController actionIndex

 March 12, 2022     yii, yii2, yii2-basic-app     No comments   

Issue

i upload all of my web folder to the root and then move all my project to inside a folder and fixed all the addresses in the main index.php

every thing works fine but i dont know for what reason this happens

this is 404 of Cpanel not me

But:

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

|

but site index Works fine

enter image description here


Solution

i found the solution in my htaccess file in the end my .htaccess become this and it is ok right now

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]


Answered By - noshad b.e
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing