Welcome Guest, Not a member yet? Register   Sign In
Different URI segments because subfolder?
#3

OK I have a better comparison now.

It's the same site, but with two environments: production and testing. I just separate the testing environment cloning the application and system folders, the front controller index.php and other files likes css, js, user and static files, etc.

At the very top of the config/routes.php I put:

PHP Code:
var_dump($this->uri->segments$this->uri->segment(1), $this->uri->total_segments());exit; 

The production (normal) URL works great:
Code:
http://xyz.hospedagemdesites.ws/index.php/energia/nobreak

Code:
Output:
array(2) {
 [1]=>
 string(7) "energia"
 [2]=>
 string(7) "nobreak"
}
string(7) "energia"
int(2)

The testing URL, and now things get weird:
Code:
http://xyz.hospedagemdesites.ws/HOMOLOGACAO/index.php/energia/nobreak

Code:
Output:
array(4) {
 [1]=>
 string(11) "HOMOLOGACAO"
 [2]=>
 string(9) "index.php"
 [3]=>
 string(7) "energia"
 [4]=>
 string(7) "nobreak"
}
string(11) "HOMOLOGACAO"
int(4)

I'm getting different segments just because the index.php is inside a subfolder, is that right? Even more, the index.php itself turns out as a segment Confused
Reply


Messages In This Thread
RE: $this->uri->segment(1) with subfolder - by fmertins - 07-13-2017, 02:31 PM



Theme © iAndrew 2016 - Forum software by © MyBB