Need help with routes |
[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
[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.
[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 |
Welcome Guest, Not a member yet? Register Sign In |