![]() |
Need help with routes - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Need help with routes (/showthread.php?tid=30570) |
Need help with routes - El Forum - 05-19-2010 [eluser]a.j.[/eluser] Hi, I'm using i18n Multi-language Library Helper for my multilanguage site. In routes.php I have: Code: $route['default_controller'] = "main"; 1. http://sitename/en/news/news-name How to make this url work properly? 2. How to redirect incorrect urls to main/index? e.g. http://sitename/incorrectstring redirect to http://sitename/news http://sitename/en/incorrectstring redirect to http://sitename/en/news Thanks in advance Need help with routes - El Forum - 05-21-2010 [eluser]a.j.[/eluser] anybody? ![]() Need help with routes - El Forum - 05-21-2010 [eluser]deczo[/eluser] The problem is that you reroute urls only once so 'en/news/anything' becomes 'news/anything' according to Code: $route['^(\w{2})/(.*)$'] = '$2'; I'm not familiar with internationalization library, but I'am pretty sure it provides a controller serving language segments that are removed from the uri with the above rules, so you can't use own rules like those: Code: //it's for english Show your main controller code so I can make this out. Need help with routes - El Forum - 06-01-2010 [eluser]a.j.[/eluser] Thanks for your respond. Here is my controller: Code: function index() So, how to redirect to index if user types wrong url? e.g. www.sitename.com/newsss |