gpt4 book ai didi

php - laravel 5 https 对任何路由总是 404

转载 作者:太空宇宙 更新时间:2023-11-03 13:37:04 24 4
gpt4 key购买 nike

我有 laravel 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

服务器名不需要 aws 才能工作。

最佳答案

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

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

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

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

关于php - laravel 5 https 对任何路由总是 404,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36615336/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com