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

#1
[eluser]itibook[/eluser]
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:

my-title-1.1-is-ok

(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:

Code:
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:

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

while url_title give me this:

Code:
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

Luca

#2
[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

#3
[eluser]itibook[/eluser]
Hi Colin,

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

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

I changed it to

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

and it now works...

thank you very much Colin, really appreciated

ciao

Luca

#4
[eluser]suba[/eluser]
where is this location in CI

#5
[eluser]itibook[/eluser]
application\config\config.php

#6
[eluser]suba[/eluser]
thanks..


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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