CodeIgniter Forums
current_url() & uri_string() returns wrong url?! - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: current_url() & uri_string() returns wrong url?! (/showthread.php?tid=21947)



current_url() & uri_string() returns wrong url?! - El Forum - 08-25-2009

[eluser]Mikle[/eluser]
When I go to page:
http://rv.local/info/about.html

current_url()
returns
http://rv.local/info/about_html

uri_string()
returns
/info/about_html

And where id dot?

PS: I call current_url(), uri_string() from _remap of my main controller.


current_url() & uri_string() returns wrong url?! - El Forum - 08-25-2009

[eluser]renownedmedia[/eluser]
What about just using the segment function from the uri helper?

$this->uri->segment(n)


current_url() & uri_string() returns wrong url?! - El Forum - 08-25-2009

[eluser]Mikle[/eluser]
[quote author="Thomas Hunter" date="1251230219"]What about just using the segment function from the uri helper?

$this->uri->segment(n)[/quote]

echo $this->uri->segment(2);
return:
about_html

I think there is a bug in CI code...


current_url() & uri_string() returns wrong url?! - El Forum - 08-25-2009

[eluser]pistolPete[/eluser]
Read these threads:
http://ellislab.com/forums/viewthread/114218/#578089
http://ellislab.com/forums/viewthread/75734/P30/


current_url() & uri_string() returns wrong url?! - El Forum - 08-25-2009

[eluser]Mikle[/eluser]
Thanks, pistolPete!