![]() |
uri_segment and characters substitution - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html) +--- Thread: uri_segment and characters substitution (/thread-22771.html) |
uri_segment and characters substitution - El Forum - 09-19-2009 [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 uri_segment and characters substitution - El Forum - 09-19-2009 [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 uri_segment and characters substitution - El Forum - 09-20-2009 [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 uri_segment and characters substitution - El Forum - 09-20-2009 [eluser]suba[/eluser] where is this location in CI uri_segment and characters substitution - El Forum - 09-20-2009 [eluser]itibook[/eluser] application\config\config.php uri_segment and characters substitution - El Forum - 09-21-2009 [eluser]suba[/eluser] thanks.. |