【问题标题】:laravel 5.6 not redirecting properlylaravel 5.6 没有正确重定向
【发布时间】:2019-12-19 20:40:25
【问题描述】:

我在子文件夹中设置 laravel 5.6,但它给出错误页面没有正确重定向。我已经用 htaceess 尝试了一切。我已经在根文件夹和公用文件夹中设置了 htacess,但它不工作 我的根 htaccess 是

<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
    Options -MultiViews
</IfModule>

RewriteEngine On

# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

</IfModule>

这是我的公用文件夹的 htacess

<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On    
RewriteBase /charity-frontmode/

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php [L]

请帮忙!提前致谢

【问题讨论】:

标签: php laravel .htaccess


【解决方案1】:

试试下面的

RewriteEngine on
RewriteCond %{REQUEST_URI} !^public
RewriteRule ^(.*)$ public/$1 [L]

【讨论】:

  • 对不起,我也试过了,但没用
  • 你在现场得到了什么?
  • 它现在似乎可以工作了我的代码中缺少一些东西。请投赞成票。谢谢
猜你喜欢
  • 2018-04-14
  • 2019-03-25
  • 2020-02-05
  • 2020-10-10
  • 2019-07-23
  • 2020-02-10
  • 2021-12-06
  • 2020-05-13
  • 1970-01-01
相关资源
最近更新 更多