CodeIgniter Forums
Url functions includes index.php in CI 4.2.1 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: Url functions includes index.php in CI 4.2.1 (/showthread.php?tid=82647)



Url functions includes index.php in CI 4.2.1 - jetspeed - 08-03-2022

Hi guys,

I noticed another thing with the update from CI 4.1.9 to 4.2.1.

Functions which return a URL (e.g. anchor(), current_url()) will result in the url being appended with index.php.

For example:

PHP Code:
echo anchor('subdir''link'); 

Will produce

PHP Code:
<a href="https://mysite.url/public/index.php/subdir">link</a

Is there any setting to remove index.php from the url? This behaviour was not there in CI 4.1.9.


RE: Url functions includes index.php in CI 4.2.1 - MGatner - 08-04-2022

The URL functions that deal with project URLs (I.e. URLs to your own routes) use your app.baseURL and app.indexPage settings. Check Config\App to make sure you have those set how you want them.


RE: Url functions includes index.php in CI 4.2.1 - jetspeed - 08-04-2022

(08-04-2022, 03:18 AM)MGatner Wrote: The URL functions that deal with project URLs (I.e. URLs to your own routes) use your app.baseURL and app.indexPage settings. Check Config\App to make sure you have those set how you want them.
Thanks for pointing that out. I re-checked my Config\App, and found I stupidly overwrote it without merging the changes.