252 php 报 Not Found The requested URL /index.php was not found on this server.怎么办?

https://blog.csdn.net/wanganji5252/article/details/81736807 转载自这里

Not Found The requested URL /index.php was not found on this server.

看提示是URL地址错误。原因是没有设置服务器地址重写,或者是设置了.htaccess文件,但没有打开重写功能。

解决办法是增加一个.htaccess文件,里面加上重写规则

RewriteEngine On
 
# The RewriteBase / instruction is commented. Remove the "#" to uncomment
# RewriteBase /
 
# Memory Limit
# php_value memory_limit 256M
# php_value max_execution_time 18000
 
# Disable Hotlinking
# Replace "domain.tld" with your domain name
# Don't forget to add a picture "thepic.gif" on your server 
# RewriteCond %{HTTP_REFERER} !^http://(.+\.)?domain\.tld/ [NC]
# RewriteCond %{HTTP_REFERER} !^$
# Solution 1 : Displays another picture from an URL
# RewriteRule .*\.(jpe?g|gif|bmp|png)$ http://www.domain.tld/thepic.gif [L]
# Solution 2 : Displays a 403 forbidden
# RewriteRule .*\.(jpe?g|gif|bmp|png)$ - [F]
 
# Forces the "www"
# RewriteCond %{HTTP_HOST} !^www\.yourdomain\.tld$ [NC]
# RewriteRule ^(.*)$ http://www.yourdomain.tld/$1 [QSA,L,R=301]
 
# Uncomment these lines to display the off.html page to other IP than the one bellow
# RewriteCond %{REMOTE_ADDR} !^127.0.0.1$
# RewriteCond %{REQUEST_FILENAME} !-f
# RewriteRule ^(.*) off.html
 
# DO NOT MODIFY ANY FOLLOWING LINE
 
# Iemis Rules
# Keep these lines even in maintenance mode, to have an access to the website
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|robots\.txt)
RewriteRule ^(.*)$ index.php?/$1
#RewriteCond %{HTTP_HOST} !^(www)\. [NC]
#RewriteRule ^(.*)$ index.php/$1 [L,QSA]
#RewriteRule ^(.*)$ index.php/$1 [L,P]
 
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(application|modules|plugins|system|themes) index.php?/$1 [L]

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值