Welcome Guest, Not a member yet? Register   Sign In
Proper base url
#1
Smile 

Hello Everyone,
I'm experiencing an issue with the base URL. I've tried changing the base URL in the .env file as follows:

Code:
app.baseURL = 'http://localhost/amp'
However, I keep getting the following error:


The requested resource /amp/ was not found on this server.
When I try accessing another link, such as
Code:
/amp/frontend
I get a controller error:
Code:
Controller or its method is not found: \App\Controllers\Amp::frontend
I attempted to use a route group for amp and it works for /amp/(.*) , but not for /amp itself. 
Here’s the route configuration I used:
$routes->group('amp', function($routes) {
$routes->get('/', 'Dashboard::index');
$routes->add('authsso/(Confusedegment)', 'Dashboard::authsso/$1');
$routes->post('dashboard/grafik', 'Dashboard::grafik');
});


Does anyone have a solution for this issue?
Reply
#2

Read docs https://codeigniter4.github.io/userguide...-subfolder
and baseURL ending slash.
Simple CI 4 project for beginners codeigniter-expenses ( topic )
Reply
#3

(11-09-2024, 10:10 PM)ozornick Wrote: Read docs https://codeigniter4.github.io/userguide...-subfolder
and baseURL ending slash.

I have tried adding a trailing slash, but I’m still getting the same error. Is hosting with a subfolder the same as using a reverse proxy? Because I was provided a reverse proxy with the domain
Code:
binamarga.pu.go.id/amp/
Reply




Theme © iAndrew 2016 - Forum software by © MyBB