解决“NOT FOUND The requested URL was not found on this server”

萌新装tp5.1的操作过程中,遇到了“NOT FOUND The requested URL was not found on this server”提示,针对问题在网上找了许多没解决,后来在@小雨PP于2021-01-29 10:55:22发布的题为《解决laravel Internal Server Error The server encountered an internal error or misconfigu》文档中找到了解决方案,经测试可用。

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

版本:thinkphp5,1

症状:


       首页可进入,但是关联的其他页面无法进入, 提示“The requested URL was not found on this server”

修改方法,将上述代码替换进“.htaccess”文件

修改文档位置:tp5.1根目录下的“.htaccess”文件

如果还不能解决,往下看

1,找到apache配置文件httpd.conf配置文件中的

AllowOverride none
Require all denied

这两行,改成

      Options Indexes FollowSymLinks    

      AllowOverride All

2,找到apache配置文件httpd.conf配置并开启

LoadModule rewrite_module modules/mod_rewrite.so (如果存在这条,看看前面有没有“#”,有的话去掉)

PS:有其他问题随时留言

  • 4
    点赞
  • 29
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值