Laravel路线由于某些原因不起作用

时间:2019-06-11 21:06:03

标签: laravel webserver

Laravel路线不起作用。

这是我的.htaccess文件,它是默认的Laravel配置。它位于public / .htaccess中。

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

另外,这是httpd.conf文件

<Directory />

    AllowOverride       All
    Options             -MultiViews -Indexes -FollowSymLinks -IncludesNoExec -Includes -ExecCGI
    Require             all granted

</Directory>

<Directory "%ssitedir%/public/*">

    AllowOverride       All
    Options             -MultiViews +Indexes +FollowSymLinks +IncludesNoExec +Includes +ExecCGI
    #Options            -FollowSymLinks +SymLinksIfOwnerMatch  # Защита лучше, но нагрузка выше
    Require             all granted

</Directory>


<Directory "%ssitedir%/*">

    AllowOverride       All
    Options             -MultiViews +Indexes +FollowSymLinks +IncludesNoExec +Includes +ExecCGI
    #Options            -FollowSymLinks +SymLinksIfOwnerMatch  # Защита лучше, но нагрузка выше
    Require             all granted

</Directory>


<Directory "%sprogdir%/modules/system/html/openserver">

    AllowOverride       All
    Options             -MultiViews -Indexes -FollowSymLinks -IncludesNoExec -Includes -ExecCGI
    AddDefaultCharset   Off
    Require             all granted
    Require             ip 127.0.0.0/8 ::1/128
    Require             ip %ips%
    %allow%Require      all granted

</Directory>

<Directory "%sprogdir%/modules/system/html/default">

    AllowOverride       All
    Options             -MultiViews -Indexes -FollowSymLinks -IncludesNoExec -Includes -ExecCGI
    AddDefaultCharset   Off
    <IfModule dir_module>
        DirectoryIndex  index.html
    </IfModule>
    Require             all granted

</Directory>

我正在使用 OpenServer V5.2.2 Apache V2.4

mod_rewrite已启用。 我猜想,我在config中的目录存在一些问题,但是我不知道在哪里。

有人知道如何解决吗?

0 个答案:

没有答案