CodeIgniter Forums
url controller item id after base url - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: url controller item id after base url (/showthread.php?tid=62780)



url controller item id after base url - rchiu5hk - 08-25-2015

Dear all,

Can I have below url path structure in index controller??

www.xxxxxx.com/123

then it will show the item id=123 profile web page.
Is it possible??


RE: url controller item id after base url - pdthinh - 08-26-2015

(08-25-2015, 11:58 PM)rchiu5hk Wrote: Dear all,

Can I have below url path structure in index controller??

www.xxxxxx.com/123

then it will show the item id=123 profile web page.
Is it possible??

You can add a custom route at bottom of the config/routes.php file

PHP Code:
$route['(:num)'] = 'controller_name/profile/$1'

Read more http://www.codeigniter.com/user_guide/general/routing.html