导航到另一个页面时显示 404 错误

时间:2021-04-13 09:22:57

标签: php laravel .htaccess

所以我建立了一个网站,并成功将其上传到使用 Plesk 的共享主机 主页加载并且可以正常工作,但是每当我尝试导航到另一个页面时,我都会收到此错误

HTTP Error 404.0 - Not Found

您要查找的资源已被删除、更名或暂时不可用。

是我可以在我的 .htacceess 文件中添加或更改的任何内容

<IfModule mod_rewrite.c>

<IfModule mod_negotiation.c>
    Options -MultiViews
</IfModule>

RewriteEngine On

##
## You may need to uncomment the following line for some hosting environments,
## if you have installed to a subdirectory, enter the name here also.
##
# RewriteBase /

##
## Uncomment following lines to force HTTPS.
##
# RewriteCond %{HTTPS} off
# RewriteRule (.*) https://%{SERVER_NAME}/$1 [L,R=301]

##
## Black listed folders
##
RewriteRule ^bootstrap/.* index.php [L,NC]
RewriteRule ^config/.* index.php [L,NC]
RewriteRule ^vendor/.* index.php [L,NC]
RewriteRule ^storage/cms/.* index.php [L,NC]
RewriteRule ^storage/logs/.* index.php [L,NC]
RewriteRule ^storage/framework/.* index.php [L,NC]
RewriteRule ^storage/temp/protected/.* index.php [L,NC]
RewriteRule ^storage/app/uploads/protected/.* index.php [L,NC]

##
## White listed folders
##
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} !/.well-known/*
RewriteCond %{REQUEST_FILENAME} !/storage/app/uploads/.*
RewriteCond %{REQUEST_FILENAME} !/storage/app/media/.*
RewriteCond %{REQUEST_FILENAME} !/storage/temp/public/.*
RewriteCond %{REQUEST_FILENAME} !/themes/.*/(assets|resources)/.*
RewriteCond %{REQUEST_FILENAME} !/plugins/.*/(assets|resources)/.*
RewriteCond %{REQUEST_FILENAME} !/modules/.*/(assets|resources)/.*
RewriteRule !^index.php index.php [L,NC]

##
## Block all PHP files, except index
##
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} \.php$
RewriteRule !^index.php index.php [L,NC]

##
## Standard routes
##
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

我该如何解决这个问题

enter image description here

1 个答案:

答案 0 :(得分:1)

所以问题是我在我的本地主机上使用 Apache 而我的主机使用的是 IIS 解决方案是使用 .htaccess

插入的 web.config 文件
相关问题