CodeIgniter 4 routes not working properly |
I just got into CI4 from a CI3 background but I'm finding it difficult to get routes to display the appropriate view. Even though I have written the code in the controller properly to load a view, it always returns index.php no matter what instead of the correct view even when I enter a non-existent route. The 404 page doesn't show either. Please, what am I missing?
Here's my controller code:
Code: <?php Here's the result I get on the browser:
If you want it go to Shop then you need to create a route for it.
Did you setup your base url in app/Config/App.php What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(11-17-2020, 09:43 PM)InsiteFX Wrote: If you want it go to Shop then you need to create a route for it. Tried that, didn't work still. It doesn't show the 404 page for non-existent routes too. I noticed that the mod.rewrite module was disabled all this while by running "sudo a2query -m rewrite", I don't know if this helps. I'd enable the mod.rewrite module and see what happens. SOLVED: I simply enabled mod.rewrite by running "sudo a2enmod rewrite" and everything works as expected now. |
Welcome Guest, Not a member yet? Register Sign In |