doushengyou2617 2018-05-18 16:07
浏览 72
已采纳

将Laravel应用程序部署到共享主机后,错误的分页链接

I used ajax to Load pagination content in its frame. Everything was OK in Local host. For example in http://localhost:8000/exampleroute pagination link for comments section , page 2 is: http://localhost:8000/content/page_comments?page=2 and works well.

But in shared host is: https://example.com/content/page_comments?%2Fexampleroute=&page=2 and links not work. I guess the problem is related to .htaccess file. so .htaccess contents here:

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
  ErrorDocument 404 /index.php
</IfModule>

What is base problem?

  • 写回答

1条回答 默认 最新

  • dqby43944 2018-05-18 16:21
    关注

    RewriteBase / seems like it could be the issue.

    Remove it and compare against https://laravel.com/docs/5.6/installation#pretty-urls. Make sure in your .env file you have APP_URL value set to your application url.

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

报告相同问题?

悬赏问题

  • ¥15 基于OPENCV的人脸识别
  • ¥30 Windows Server 2016利用兩張網卡處理兩個不同網絡
  • ¥15 Python中knn问题
  • ¥15 使用C#,asp.net读取Excel文件并保存到Oracle数据库
  • ¥15 C# datagridview 单元格显示进度及值
  • ¥15 thinkphp6配合social login单点登录问题
  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量