【问题标题】:Laravel DELETE operation returns 403Laravel DELETE 操作返回 403
【发布时间】:2021-03-12 23:55:59
【问题描述】:

我正在使用 VPS 在子域下托管从 codecanyon 购买的 Laravel 应用程序

https://mobile.tastebud.com.my/

Laravel 项目文件夹位于 /public_html/mobile - 子文件夹。

Laravel 版本 - VERSION = '5.8.38';

这个应用API是从flutter移动应用调用的

现在似乎大部分事情都在工作,除了 DELETE(到目前为止我发现它)API 请求被 403 Forbidden 拒绝

“/public_html/mobile/public/.htaccess”的内容

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

    # 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>

**任何线索有什么问题?或者至少我在哪里可以找到更多信息来进一步调查**

我试过了

Why does my web server software disallow PUT and DELETE requests?

Laravel route method DELETE not working

【问题讨论】:

    标签: laravel


    【解决方案1】:

    我想通了。这必须添加到 apache vhost 文件中
    要求全部授予

    <Directory "/home/tastebud/public_html/mobile">
        Options -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
        AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
        Require all granted
        SSLRequireSSL
    </Directory>
    

    这成功了

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-03-23
      • 2023-01-07
      • 1970-01-01
      • 2020-04-20
      • 2018-11-22
      • 2018-10-01
      相关资源
      最近更新 更多