laravel 5 https总是404用于任何路线

时间:2016-04-14 06:29:40

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

我在lasvel 5上使用apache2在aws上运行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 enter image description here

ssl.conf enter image description here

服务器名称不适合用于工作。

1 个答案:

答案 0 :(得分:0)

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

ssl conf需要&#34;镜像&#34; 000-default.conf。即

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

这部分需要从000-default.conf

复制到apache ssl conf