Welcome Guest, Not a member yet? Register   Sign In
Urls with more parameters do not work
#1

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_detai...t42-laptop
But when I tried to add more parameters, like :
http://local-wprods.com/price_list_detai...er_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!
Reply
#2

(: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'
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB