,我在 Laravel 中有一个项目,我已经将它上传到我的域中,一切都很顺利,但现在我遇到了一个大麻烦问题,问题是所有页面都给我这个消息: 图像,告诉我:未找到 在此服务器上找不到所请求的 URL。 此外,尝试使用 ErrorDocument 处理请求时遇到 404 Not Found 错误。 我不知道这个问题是如何产生的,但我认为因为我删除了index.php文件并放置了一个新的文件,该文件来自flutter,但是,我返回了原始的index.php文件,并且问题仍然存在。 注意index.php 页面可以工作,但 API 路由器不起作用。
检查您的默认
.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]
# Send Requests To Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>