index.php login 404,网站任何路径请求都是404,访问日志都是GET /index.php,似乎都被定向到index.php了,怎么回事?...

无论我访问root.com/还是root.com/index.html,都是404打不开页面,我查看访问日志,发现不管什么路径的请求都会被定向到/index.php上

日志:

#Software: Microsoft Internet Information Services 6.0

#Version: 1.0

#Date: 2017-02-23 12:22:05

#Fields: date time s-sitename s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status

2017-02-23 12:22:05 W3SVC223192134 121.199.27.219 GET /index.php - 80 - 117.136.81.240 Mozilla/5.0+(iPhone;+CPU+iPhone+OS+10_2_1+like+Mac+OS+X)+AppleWebKit/602.1.50+(KHTML,+like+Gecko)+CriOS/56.0.2924.79+Mobile/14D27+Safari/602.1 404 0 2

2017-02-23 12:22:05 W3SVC223192134 121.199.27.219 GET /favicon.ico - 80 - 117.136.81.240 Mozilla/5.0+(iPhone;+CPU+iPhone+OS+10_2_1+like+Mac+OS+X)+AppleWebKit/602.1.50+(KHTML,+like+Gecko)+CriOS/56.0.2924.79+Mobile/14D27+Safari/602.1 404 0 2

#Software: Microsoft Internet Information Services 6.0

#Version: 1.0

#Date: 2017-02-23 12:42:35

#Fields: date time s-sitename s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status

2017-02-23 12:42:35 W3SVC223192134 121.199.27.219 GET /index.php - 80 - 121.199.27.219 Mozilla/5.0+(Windows+NT+5.2)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/47.0.2526.106+Safari/537.36 404 0 2

2017-02-23 12:42:35 W3SVC223192134 121.199.27.219 GET /index.php - 80 - 121.199.27.219 Mozilla/5.0+(Windows+NT+5.2)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/47.0.2526.106+Safari/537.36 404 0 2

2017-02-23 12:42:37 W3SVC223192134 121.199.27.219 GET /index.php - 80 - 121.199.27.219 Mozilla/5.0+(Windows+NT+5.2)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/47.0.2526.106+Safari/537.36 404 0 2

2017-02-23 12:42:40 W3SVC223192134 121.199.27.219 GET /favicon.ico - 80 - 121.199.27.219 Mozilla/5.0+(Windows+NT+5.2)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/47.0.2526.106+Safari/537.36 404 0 2

2017-02-23 12:42:40 W3SVC223192134 121.199.27.219 GET /index.php - 80 - 121.199.27.219 Mozilla/5.0+(Windows+NT+5.2)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/47.0.2526.106+Safari/537.36 404 0 2

2017-02-23 12:42:41 W3SVC223192134 121.199.27.219 GET /index.php - 80 - 121.199.27.219 Mozilla/5.0+(Windows+NT+5.2)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/47.0.2526.106+Safari/537.36 404 0 2

2017-02-23 12:42:41 W3SVC223192134 121.199.27.219 GET /favicon.ico - 80 - 121.199.27.219 Mozilla/5.0+(Windows+NT+5.2)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/47.0.2526.106+Safari/537.36 404 0 2

2017-02-23 12:42:42 W3SVC223192134 121.199.27.219 GET /favicon.ico - 80 - 121.199.27.219 Mozilla/5.0+(Windows+NT+5.2)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/47.0.2526.106+Safari/537.36 404 0 2

2017-02-23 12:45:49 W3SVC223192134 121.199.27.219 GET /index.php - 80 - 27.17.73.166 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/55.0.2883.44+Safari/537.36 404 0 2

2017-02-23 12:45:49 W3SVC223192134 121.199.27.219 GET /favicon.ico - 80 - 27.17.73.166 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/55.0.2883.44+Safari/537.36 404 0 2

2017-02-23 12:45:55 W3SVC223192134 121.199.27.219 GET /index.php - 80 - 27.17.73.166 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/55.0.2883.44+Safari/537.36 404 0 2

网站的默认文档有这些,并没有设置index.php:

bVJFCl?w=603&h=469

请问这是怎么回事?我要怎么解决?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,我可以帮你设计一个登录页面index.html,基于login.php。 首先,我们需要在index.html页面中添加一个表单,以便用户输入用户名和密码。表单的代码如下: ```html <!DOCTYPE html> <html> <head> <title>Login Page</title> </head> <body> <h1>Login Page</h1> <form action="login.php" method="POST"> <label for="username">Username:</label> <input type="text" id="username" name="username"><br><br> <label for="password">Password:</label> <input type="password" id="password" name="password"><br><br> <input type="submit" value="Login"> </form> </body> </html> ``` 在这个表单中,我们有两个输入框,分别用于输入用户名和密码。表单的提交目标是login.php页面,使用POST方法提交表单数据。 接下来,我们需要在login.php页面中接收表单数据,并验证用户的登录信息是否正确。login.php的代码如下: ```php <?php // 获取提交的表单数据 $username = $_POST['username']; $password = $_POST['password']; // 假设正确的用户名和密码分别为admin和123456 if ($username == 'admin' && $password == '123456') { // 登录成功,跳转到首页 header('Location: home.html'); } else { // 登录失败,返回登录页面 header('Location: index.html'); } ?> ``` 在这个代码中,我们首先通过$_POST数组获取表单提交的用户名和密码。然后,我们假设正确的用户名和密码分别为admin和123456,如果用户输入的信息与正确信息匹配,则跳转到首页home.html,否则返回登录页面index.html。 注意:这里的用户名和密码是示例,实际应用中不应该使用硬编码的方式存储用户名和密码。可以考虑将用户名和密码存储在数据库中,并使用PHP的MySQLi或PDO扩展来进行数据库操作。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值