• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
404 error on simple controller

#1
Hi.

I previously used CI 3 and i am new to CI 4.

My URL is accessible in :
Code:
http://localhost/my_git/ci4/public/

I have a simple controller like this
PHP Code:
<?php namespace App\Controllers;

use 
CodeIgniter\Controller;

class 
Cron extends BaseController
{
    public function 
test() {
        
var_dump($this->request->uri->getSegment(3));
    }


I have adjusted my app/Config/App.php :
PHP Code:
public $baseURL 'http://localhost/my_git/ci4/public/'




My problem is :
if i open 
Code:
http://localhost/my_git/ci4/public/index.php/Cron/test/

I am redirected to
Code:
http://localhost/index.php/Cron/test


But if i open
Code:
http://localhost/my_git/ci4/public/index.php/Cron/test/abcdefg

It works correctly to the controller.

I have not modified routes.

Is there anything i should check?

Thank you.
Reply


Messages In This Thread
404 error on simple controller - by newcicoder - 07-30-2020, 06:30 AM
RE: 404 error on simple controller - by jreklund - 08-01-2020, 06:27 AM
RE: 404 error on simple controller - by jreklund - 08-01-2020, 06:57 AM
RE: 404 error on simple controller - by jreklund - 08-01-2020, 08:40 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.