dou4381 2014-02-11 07:35
浏览 37
已采纳

用于控制器路由的Laravel通配符?

I defined a Route for grouping controller routes and after using this URL :

http://localhost/alachiq/public/admin/profile

it can show profile view. but if user entered:

http://localhost/alachiq/public/admin/profile/

that redirects to http://localhost/admin/profile and I get this error:

Not Found

The requested URL /admin/profile was not found on this server.
Apache/2.4.6 (Debian) Server at localhost Port 80

how to use a wildcard in controller?

my Route:

Route::group(array('prefix'=> 'admin' ,'before'=>'auth'), function(){
    Route::controller('profile', 'ProfileController',array('getIndex'=>'profile.index', 'postUpdate'=>'profile.update'));

});
  • 写回答

2条回答 默认 最新

  • duanmeng9336 2014-02-11 07:50
    关注

    I guess your DocumentRoot should be /path/to/alachiq/public, but if you want it to stay how it is here, you have to modify the htaccess to take the subfolders into account.
    It would look like this RewriteRule ^(.*)/$ /alachiq/public/$1 [L,R=301]

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 微信小程序商城如何实现多商户收款 平台分润抽成
  • ¥15 cocos的js代码调用wx.createUseInfoButton问题!
  • ¥15 关于自相关函数法和周期图法实现对随机信号的功率谱估计的matlab程序运行的问题,请各位专家解答!
  • ¥15 Python程序,深度学习,有偿私
  • ¥15 扫描枪扫条形码出现问题
  • ¥35 poi合并多个word成一个新word,原word中横版没了.
  • ¥15 【火车头采集器】搜狐娱乐这种列表页网址,怎么采集?
  • ¥15 求MCSCANX 帮助
  • ¥15 机器学习训练相关模型
  • ¥15 Todesk 远程写代码 anaconda jupyter python3