• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
uri_segment and characters substitution

Hi all,

as always, sorry if this looks silly. I did search for a while, but did not find anything similar.

I have a uri_segment like the following:


(this could be a blog post title for example)

the uri was generated via the url_title() function, so nothing funny there.

The issue is that when I try to match uri_segment with the database title I do as follows:

if(uri_segment(x) == url_title(my-db-title))

The match fails and is caused by the "." characters being substituted with a "_" in the uri_segment function.

Basically the uri_segment gives me this:

uri_segment(x) -> my-title-1_1-is-ok

while url_title give me this:

url_title('my title 1.1 is ok') ->  my-title-1.1-is-ok

I am really a bit lost at this... I am sure I am missing something easy, but as I am starting this is not that obvious at the moment... :-)

thanks in advance


[eluser]Colin Williams[/eluser]
Set uri_protocol in config to REQUEST_URI. The server does this replacement on the PATH_INFO environment variable. It has nothing to do with CI, except that you have instructed CI to use PATH_INFO

Hi Colin,

spot on... I had the following setting from the CI install

$config['uri_protocol']    = "AUTO";

I changed it to

$config['uri_protocol']    = "REQUEST_URI";

and it now works...

thank you very much Colin, really appreciated



where is this location in CI



Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.