![]() |
Problem with routes.php and brackets - 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: Problem with routes.php and brackets (/showthread.php?tid=40400) |
Problem with routes.php and brackets - El Forum - 04-07-2011 [eluser]umbungo[/eluser] When trying to re-route a name with brackets in it i get a 404. Is it possible to fix this / how? Thanks. Problem with routes.php and brackets - El Forum - 04-09-2011 [eluser]umbungo[/eluser] anyone? please? Problem with routes.php and brackets - El Forum - 04-09-2011 [eluser]osci[/eluser] Not sure if it helps but check adding them in application/config.php at $config['permitted_uri_chars'] Problem with routes.php and brackets - El Forum - 04-10-2011 [eluser]WanWizard[/eluser] Route's are regex definitions, you can't just include characters in a route that have special meaning in a PHP regex. Like a bracket. Try escaping it with a backslash. Problem with routes.php and brackets - El Forum - 04-11-2011 [eluser]umbungo[/eluser] hmm.. Thanks for the replies.. i tried both of these suggestions and no joy. Would it only be the first half that needs escaping? eg.. Code: $route['Name-With-\(Brackets\)'] = "main/main/Name-With-(Brackets)"; Problem with routes.php and brackets - El Forum - 04-14-2011 [eluser]umbungo[/eluser] still stuck on this one Problem with routes.php and brackets - El Forum - 04-14-2011 [eluser]danmontgomery[/eluser] Seems like it would be more appropriate to be using backreferences ($1, $2, etc) for parameters? Problem with routes.php and brackets - El Forum - 04-16-2011 [eluser]umbungo[/eluser] AHHHHHHHHHHH finally. Escaping the brackets does not work. I tried double/triple/quadruple escaping them too. After several hours staring at /trying to figure out /playing with the code trying to get things to work i finally got to the solution; Code: $route['Name-With-&\#40;Brackets&\#41;'] = "main/main/Name-With-(Brackets)"; Code: 'Name-With-&\#x28;Brackets&\#x29;' note: I ******* HATE THESE ISSUES WITH CHARACTER ENCODING. How are you meant to tell what form it is deciding to take today? Almost impossible to debug too; echo anything in the browser and it comes out as normal text. |