douliu8327 2015-08-27 13:46
浏览 72
已采纳

未找到Laravel 5.1分页URL错误404

I am using Laravel 5.1 on WAMP Server 2.5.

And I have this error while working on pagination.

404 Not Found

While I run my site locally using this php artisan serve

php artisan serve --port=212

I run to my site index url http://localhost:212/displays. The pagination works fine, its pagination link work fine on every page http://localhost:212/displays?page=2.

But when I run it manualy without php artisan serve (http://localhost/bookstore/public/displays), the pagination link goes wrong. The pagination link originally printout http://localhost/bookstore/public/displays/?page=2, but it automatically change into http://localhost/displays?page=2 when the page fully rendered.

Is anyone have same problem like me? Glad if any of you could help.

  • 写回答

1条回答 默认 最新

  • dongyu8694 2015-08-27 13:53
    关注

    This is likely because you're meant to set the web root on your server to the public folder (and Laravel assumes that that's the case).

    As it is, your web root is set to somewhere two levels above the public folder, so when Laravel tries to redirect to /displays?page=2 it tries to send you to the wrong folder.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?