【问题标题】:laravel 5 https always 404 for any routelaravel 5 https 对于任何路线总是 404
【发布时间】:2016-08-05 13:10:21
【问题描述】:

我有 laravel 5 在 aws 上使用 apache2 运行 ubuntu。该站点和路由无需 http 即可工作。

当被击中时,例如https://example.com,只有首页有效。其他页面返回 404。例如https://example.com/home 返回 404

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

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>

000-default.conf

ssl.conf

没有服务器名称,aws 才能正常工作。

【问题讨论】:

  • 我也遇到同样的问题,你解决了吗?

标签: php amazon-web-services ssl https laravel-5


【解决方案1】:

基于此:How can I fix Laravel 5.1 - 404 Not Found?

ssl conf 需要“镜像” 000-default.conf。即

<Directory>
......
</Directory>

这部分需要从000-default.conf复制到apache ssl conf

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-09-05
    • 2015-12-24
    • 1970-01-01
    • 2021-02-20
    • 2016-11-18
    • 2018-12-07
    • 2018-10-04
    • 2018-10-23
    相关资源
    最近更新 更多