代码之家  ›  专栏  ›  技术社区  ›  DarkFenix

为什么当我多次查询服务器时,Laravel返回405错误

  •  0
  • DarkFenix  · 技术社区  · 4 年前

    我在尝试访问搜索路径时遇到错误405。POST方法。我发送了10个请求,其中9个正确处理,1个有错误,或者这个数字是相对的。

    我不知道它是laravel、apache还是PHP版本配置?你能指导我吗,我可以展示你要求的文件。这只发生在我的生产服务器上。

    .htaccess文件

    <IfModule mod_rewrite.c>
        <IfModule mod_negotiation.c>
            Options -MultiViews -Indexes
        </IfModule>
        Options -MultiViews -Indexes
        RewriteEngine On 
        RewriteCond %{HTTPS} off 
        RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
        # Handle Authorization Header
        RewriteCond %{HTTP:Authorization} .
        RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
        # Redirect Trailing Slashes If Not A Folder...
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_URI} (.+)/$
        RewriteRule ^ %1 [L,R=301]
        # Handle Front Controller...
        RewriteCond %{REQUEST_URI} !(\.svg|\.ico|\.json|\.css|\.js|\.png|\.jpg|\.gif|\.woff)$ [NC]
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule ^ index.php [L]
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_URI} !^/public/
        RewriteRule ^(css|js|img|fonts|audios|imagenes|svg|storage)/(.*)$ public/$1/$2 [L,NC]
    
    </IfModule>
    
    # php -- BEGIN cPanel-generated handler, do not edit
    # Set the “ea-php72” package as the default “PHP” programming language.
    <IfModule mime_module>
      AddHandler application/x-httpd-ea-php72 .php .php7 .phtml
    </IfModule>
    # php -- END cPanel-generated handler, do not edit
    
    0 回复  |  直到 4 年前
        1
  •  0
  •   Mohammad Akbari    4 年前

    可能程序员在该路径上设置了一个油门,在几次请求后,它达到了限制并返回405