Welcome Guest, Not a member yet? Register   Sign In
Uri segments not working?
#1

[eluser]@li[/eluser]
Hi,

I'm not sure if there's something wrong with my apache configuration (.htaccess and mod_rewrite is working) or something messed up when I upgraded to the latest codeigniter version, but my uri segments aren't working anymore.

When I go to site.com/segment and try to access 'segment' through:
Code:
$this->uri->segment(1);

it returns empty. Also when I try:

Code:
$this->uri->uri_to_assoc();


it returns:
Quote:Array ( )

Any ideas about this?
#2

[eluser]MCrittenden[/eluser]
Are you using "accos" instead of "assoc" in your code like in the post? I know that's probably just a typo in this post but gotta make sure.
#3

[eluser]@li[/eluser]
Sorry about that, I was typing in a hurry. In real code I'm using assoc, otherwise i'd have gotten an error
#4

[eluser]ontguy[/eluser]
Something may have changed in your config files, is uri_protocol set to AUTO or
Code:
$config['uri_protocol']    = "REQUEST_URI";
#5

[eluser]@li[/eluser]
Thanks for that, in the config file it has the uri protocol set to 'auto'. If I change it to REQUEST_URI I get a 404 error whenever I visit any page. Changing it back to AUTO works. Any ideas?
#6

[eluser]ontguy[/eluser]
Does
Code:
$this->uri->uri_string()
give any output?




Theme © iAndrew 2016 - Forum software by © MyBB