How to remove controller name from the URL in codeigniter?

前端 未结 4 573
南笙
南笙 2020-12-20 03:00

I have controller named “profile” and the URL for user profile is www.example.com/profile/user

I am already using the rerouting of codeigniter in the routes file

4条回答
  •  青春惊慌失措
    2020-12-20 03:50

    If I understand your question correctly, you just want to add a catchall to the very end of your routes file. Like:

    $route['(:any)'] = 'profile/index';
    

    This will catch everything that isn't caught by another route, so make sure this script contains logic to determine when a 404 should be presented.

提交回复
热议问题