CodeIgniter Forums
Urls with more parameters do not work - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Installation & Setup (https://forum.codeigniter.com/forumdisplay.php?fid=9)
+--- Thread: Urls with more parameters do not work (/showthread.php?tid=66736)



Urls with more parameters do not work - mstdmstd - 11-26-2016

Hi,
I make routes rule :

PHP Code:
$route['price_list_details/:any'] = 'products/details'
and it works for url
http://local-wprods.com/price_list_details/ibm-thinkpad-t42-laptop
But when I tried to add more parameters, like :
http://local-wprods.com/price_list_details/ibm-thinkpad-t42-laptop/filter_title/a
I got error url not found.

codeigniter version: 3.1.0,
PHP Code:
In config $config['permitted_uri_chars'] = 'a-z 0-9~%.:&_\-+,\.\/'

Thanks!


RE: Urls with more parameters do not work - InsiteFX - 11-26-2016

(:num) will match a segment containing only numbers. (:any) will match a segment containing any character (except for ‘/’, which is the segment delimiter).

With regular expressions, you can also catch multiple segments at once. For example, if a user accesses a password protected area of your web application
and you wish to be able to redirect them back to the same page after they log in, you may find this example useful:

PHP Code:
$route['login/(.+)'] = 'auth/login/$1'