Welcome Guest, Not a member yet? Register   Sign In
CI4 Base URL Behavior
#1

CI4 used to figure out the base URL all by itself. Now it doesn't even try. I get an error if I don't specify it. Why is this?

I have development, testing, staging, and production environments. I have to maintain separate .env or App.php config files for each environment. 

Also, more importantly we play games with the URLs. For example on our Drupal sites we have the same code/server running under prod-bnc3-web6 and bnc.uscourts.gov. And it works if you just stick to relative URLs. Why can't I do this with CI4? It appears when I do a redirect the URL is changed to whatever the base URL is set to in .env or App.php. This is appears to be a problem.
Simpler is always better
Reply
#2

By default it forces you to set a base url as a security measure. There's nothing stopping you from modifying the config file to scope out the current domain and use that. I've seen that done on a lot of CI3 sites in the past.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB