base_url() wrong even when explicitly set |
[eluser]madshadow[/eluser]
I have multiple environments set up for my application (development, staging, demo, production). Everything was working smoothly among the environments until I made some kind of change to enact more dynamic environment setting. The strange thing is that it works fine on my localhost and demo server, but not on staging when I am at staging.domain.com. To debug, my main landing page echoes out the ENVIRONMENT variable (which correctly shows 'staging') and then I echo out base_url which incorrectly shows (http://localhost/domain). For some reason this is only happening on staging and not on demo or localhost. I even tried removing the dynamic base_url generation and hard-coded "staging.domain.com" but it is still showing as "localhost/domain" - I am sure this is something stupid I am missing but I have been beating my head over this. Does anyone see what I'm missing? Any help would be greatly appreciated. Thank you in advance I have the following in my index.php file to set the environment variable: Code: if (isset($_SERVER['PLATFORM'])) I have the following to set the url in my config.php file (actual domain name redacted): Code: if (defined('ENVIRONMENT')) Finally, if it matters, I have the following in .htaccess file: Code: DirectoryIndex index.php |
Messages In This Thread |
base_url() wrong even when explicitly set - by El Forum - 05-15-2012, 07:22 AM
base_url() wrong even when explicitly set - by El Forum - 05-15-2012, 07:52 AM
base_url() wrong even when explicitly set - by El Forum - 05-15-2012, 09:18 AM
base_url() wrong even when explicitly set - by El Forum - 05-15-2012, 11:53 AM
base_url() wrong even when explicitly set - by El Forum - 05-15-2012, 12:10 PM
base_url() wrong even when explicitly set - by El Forum - 05-15-2012, 12:44 PM
|