【问题标题】:The requested URL /pay was not found on this serve r laravel project , Cpanel, bluehost,404 not found在此服务器 r laravel 项目中找不到请求的 URL /pay,Cpanel,bluehost,404 未找到
【发布时间】:2020-06-08 08:53:21
【问题描述】:

我网站上的主页正常工作,但网站内的链接不起作用 当我单击带有链接的按钮时,会出现“在此服务器上找不到请求的 URL /pay”错误。 我在项目文件夹中的公用文件夹有一个 .htaccess 文件 (myproject/public/.htaccess) 它包含

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

    RewriteEngine On

    # 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_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

我是托管新手 请任何帮助。 谢谢。

【问题讨论】:

    标签: laravel hosting cpanel bluehost


    【解决方案1】:

    .htaccessRewriteEngine On 之后使用以下代码

    RewriteBase /

    所以你的.htaccess 应该如下所示:

    <IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>
    
    RewriteEngine On
    RewriteBase /
    # 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_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
    

    【讨论】:

      猜你喜欢
      • 2019-09-12
      • 2015-05-18
      • 2014-09-27
      • 2017-10-31
      • 2017-01-25
      • 1970-01-01
      • 2013-09-22
      • 2017-12-26
      • 2015-03-30
      相关资源
      最近更新 更多