Proper way yo deal with uri segments? |
I have my development environment at the web server root (accessible through http://localhost:8080/), but my production installation is in a subdirectory of the web server root (https://site.lt/my_subdir/).
For some reason, the uri helper on the production environment returns the subdirectory name as the first element in the segment array. So I have to use funny workarounds to get the same segment in both installs, see code below. I do have proper base url settings in the .env files in each environment (app.baseURL variable points to the above-mentioned addresses)... So, my question is: is there a better way to use the CI4 uri helper? Is there a bug in the code? PHP Code: $uri = current_url(true);
==
Donatas G. |
Messages In This Thread |
Proper way yo deal with uri segments? - by dgvirtual - 10-11-2021, 01:29 PM
RE: Proper way yo deal with uri segments? - by includebeer - 10-12-2021, 04:05 PM
RE: Proper way yo deal with uri segments? - by iRedds - 10-13-2021, 04:28 PM
RE: Proper way yo deal with uri segments? - by dgvirtual - 10-14-2021, 12:42 AM
RE: Proper way yo deal with uri segments? - by paulkd - 10-14-2021, 01:28 AM
RE: Proper way yo deal with uri segments? - by John_Betong - 10-14-2021, 01:06 AM
RE: Proper way yo deal with uri segments? - by dgvirtual - 10-14-2021, 03:02 AM
RE: Proper way yo deal with uri segments? - by John_Betong - 10-14-2021, 03:31 AM
|