CodeIgniter with less URL segments
As you might know, the URL for codeigniter is build like this. In my case, I have:
http://example.com/subfolder/class/function/ID
Is there a way with codeigniter (or htaccess) to create this url in a much shorter url like this:
http://exampl开发者_运维技巧e.com/ID
Kind regards, Senne
In the application/configs/routes.php
file, you should be able to add something like this:
$routes['(:num)'] = 'your_controller/your_function/$1'
You can read more about custom routing here: http://codeigniter.com/user_guide/general/routing.html
You can do this by using Url Routing in CodeIgniter.
$route[':any'] = "subfolder/class/function/$1";
精彩评论