douben7260
douben7260
2015-07-01 20:58

Codeigniter 3路由问题

已采纳

I have setup a route in the routes.php file like this:

$route['videos/video'] = 'videos';

So if a user enters:

http://domain.com/videos/video/

I want it to just load the videos page which works, but the issue I am running into is that it is keeping the URL the same so when the user clicks on one of the videos from the videos page the url will look like this:

http://domain.com/videos/video/video/1

When is should look like this:

http://domain.com/videos/video/1

Is there any way to change this behavior?

Also, is there any way to hide the method in the URL?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

  • dongyanhu5628 dongyanhu5628 6年前
    $route['videos/video'] = "videos/index";
    $route['videos/video/(:num)'] = "videos/video/$1";
    
    点赞 评论 复制链接分享

为你推荐