Problems with Auto Routing and URI Segments |
Hi All,
I have set the "setAutoRoute" to true and also set $autoRoutesImproved to true in "app/Config/Feature.php" When I try to reach http://localhost/MyProjects/index.php/Home/Test -> I get success result. But When I remove index.php to reach http://localhost/MyProjects/Home/Test -> I get 404 - File Not Found *** I want to remove index.php in this Link http://localhost/MyProjects/index.php/Home/Test please guide me Thanks all (01-07-2023, 05:22 AM)kenjis Wrote: See Thanks Kenjis, I make sure the configuration is correct and working (If I set $autoRoutesImproved to true in "app/Config/Feature.php"); When I set $autoRoutesImproved to false, and I remove index.php to reach http://localhost/MyProjects/Home/Test -> I get 404 - File Not Found Since v4.2.0, the new more secure Auto Routing has been introduced. My Projects is Ci Version 4.2.11 Before set $autoRoutesImproved to true, My Project works fine, I want to use Auto Routing (Improved), I have set the "setAutoRoute" to true and also set $autoRoutesImproved to true in "app/Config/Feature.php" but My Projects don't Working. (01-07-2023, 08:07 PM)hieuhiti Wrote: Before set $autoRoutesImproved to true, My Project works fine, Do you mean when you set $autoRoutesImproved to false it works fine? If so, you don't understand auto routing improved well. Auto routing improved is completely different from legacy auto routing. You need to follow the new rules: See https://codeigniter4.github.io/CodeIgnit...to-routing (01-07-2023, 09:00 PM)kenjis Wrote:(01-07-2023, 08:07 PM)hieuhiti Wrote: Before set $autoRoutesImproved to true, My Project works fine, thank Kenjis , I'll stick with the old solution for now. If I have time I will learn more about the improved auto route and apply it
No problem.
The risk in legacy auto-routing is controller filters to be bypassed. If you don't use controller filters, you have no risk. If you use controller filters, you can check the filters with "php spark routes" command. |
Welcome Guest, Not a member yet? Register Sign In |