We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

$this->EE->config->item('index_page') returns base URL if $config["index_page"] set to empty string

Development and Programming

Michael Witwicki's avatar
Michael Witwicki
115 posts
15 years ago
Michael Witwicki's avatar Michael Witwicki

Hey team,

I just ran into an interesting situation with with a NavEE user, and I think I just need a little clarification. The EE documentation in the config file itself says:

|————————————————————————– | Index File |————————————————————————– | | Typically this will be your index.php file, unless you’ve renamed it to | something else. If you are using mod_rewrite to remove the page set this | variable so that it is blank. | (see screenshot)

However, if the user sets this variable to blank - both the $this->EE->config->item(‘index_page’) and the $this->EE->config->item(‘site_index’) variables return the base URL of the site. This seems really odd. Why would those variables not simply return an empty string if the config variable they are referencing is blank?

Thanks in advance for the help.

Michael Witwicki

       
Pascal Kriete's avatar
Pascal Kriete
2,589 posts
15 years ago
Pascal Kriete's avatar Pascal Kriete

Micheal, in what context are you trying to grab these config items: frontend or control panel?

I just tried a simple var_dump in the channel module and it’s showing me the values I would expect.

       
Michael Witwicki's avatar
Michael Witwicki
115 posts
about 15 years ago
Michael Witwicki's avatar Michael Witwicki

Hey Pascal!

This was in the frontend. I’ve not run into this previously - but noticed when trying to figure out the root of this particular NavEE user’s issue. Interestingly enough, he mentioned that he didn’t have this problem until migrating from a server running PHP 5.1.6, to one running 5.3.5.

Perhaps this was just some kind of odd configuration issue in his install?

       
Michael Witwicki's avatar
Michael Witwicki
115 posts
about 15 years ago
Michael Witwicki's avatar Michael Witwicki

Also, to clarify, when you set the config variable to blank, and then outputted $this->EE->config->item(’index_page’) from your mod.channel.php file, it came up blank? As long as that is how things should work, then I am in good shape. I just wanted to make sure that something didn’t change which forced that variable to output the base_url if the index_page config variable was set to blank.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.