Welcome Guest, Not a member yet? Register   Sign In
CI4 Redirect points back to the Default Controller only
#1

(This post was last modified: 01-11-2022, 02:27 AM by algates. Edit Reason: Include Codes as PHP )

I have a CI4 Project which works well on Windows XAMPP. But, after I upload the same project to Ubuntu, the redirect only loads the Default Controller Page.

I altered the following setting on /app/Config/Routes.php

Before Change:
PHP Code:
$routes->setDefaultController('Home');
$routes->setDefaultMethod('index'); 


After Change:
PHP Code:
$routes->setDefaultController('RunnerList');
$routes->setDefaultMethod('Raw_Data'); 


Set of Routes:
PHP Code:
$routes->get('/''Home::index');
$routes->get('runnerRawData''RunnerList::Raw_Data');
$routes->get('runnerDBData''RunnerList::MDB_Data');
$routes->get('runnerCSVData''RunnerList::CSV_Data');
$routes->get('runnerJSONData''RunnerList::JSON_Data'); 


The Default Controller loads with no issues. But, when I type in the URL to access the other functions (runnerDBData, runnerCSVData, runnerJSONData) under the Controller Module, all points to the DefaultController / DefaultMethod settings only. I have read a lot of articles and modified the .htaccess, set the correct baseurl, enabled apache2 modrewrite, but somehow nothing seems to work the trick for me.

Let me know if you need any further info - Any help would be highly appreciated!!!
Reply
#2

See https://codeigniter4.github.io/userguide...page-loads
Reply
#3

(This post was last modified: 01-11-2022, 02:29 AM by algates. Edit Reason: Change Text Font )

Based on the link provided, I tried all the following options - Still no luck ...
app/Config/App.php:
PHP Code:
public $indexPage '';

public 
$indexPage 'index.php';

public 
$indexPage 'index.php?'


I have set the following Base URL - PHPCI is my Project / Root Folder Name:
PHP Code:
public $baseURL 'http://[::1]/PHPCI/'

Also, for uriProtocol - I have tried all the 3 options as below, still no luck.
PHP Code:
public $uriProtocol 'REQUEST_URI';

public 
$uriProtocol 'QUERY_STRING';

public 
$uriProtocol 'PATH_INFO'
Reply




Theme © iAndrew 2016 - Forum software by © MyBB