CodeIgniter Forums
Why is there a index.php in my routing? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Why is there a index.php in my routing? (/showthread.php?tid=88363)



Why is there a index.php in my routing? - trunky - 08-28-2023

Hi all,
I am new to CI for like half a year and working on my second project using it. I wonder about one thing:
My "normal" routing works well, domain.tld/page1 etc, Apache is set up to drop the index.php
But when I use something like
PHP Code:
return redirect()->route('page1'
the redirects are always going to index.php/page1
Why is that (and how to prevent it)?


RE: Why is there a index.php in my routing? - kenjis - 08-28-2023

If you don't want to include index.php in your site URIs, set $indexPage to '' in the app/Config/App.php file.
The setting will be used when the framework generates your site URIs.


RE: Why is there a index.php in my routing? - trunky - 08-30-2023

Ah, this is what I forgot... Thank you!


RE: Why is there a index.php in my routing? - kenjis - 09-07-2023

I sent a PR to improve the user guide:
https://github.com/codeigniter4/CodeIgniter4/pull/7873

Can someone review it?