普通网友 2022-01-29 10:54 采纳率: 100%
浏览 94
已结题

web.config配置301HTTPS后Location url路径不对

致命的问题就是我设置了后整站HTTPS主页没问题,
返回状态码301
网页返回HEAD信息

Content-Type: text/html; charset=UTF-8

Location: https://www.dn.com/

Server: Microsoft-IIS/8.5

X-Powered-By: ASP.NET

Date: Sat, 29 Jan 2022 02:41:53 GMT

Content-Length: 146

但是检测栏目或者文章页面时,301永久转移到PHP结尾乱码上,也就是说跳转的不是MTML结尾的。
比如:dn.com/jingyan/81.html
现在是:dn.com//jingyan_show.php?id=81&%

下面是检测出来的代码
dn.com/jingyan/81.html检测结果
服务器IP182.16.13.67
返回状态码301
网页返回HEAD信息

Content-Type: text/html; charset=UTF-8

Location: https://dn.com//jingyan_show.php?id=81&%

Server: Microsoft-IIS/8.5

X-Powered-By: ASP.NET

Date: Sat, 29 Jan 2022 02:46:05 GMT

Content-Length: 175

请问老是们怎么解决这个问题啊?

  • 写回答

3条回答 默认 最新

  • CSDN专家-showbo 2022-01-29 13:45
    关注

    web.concifg怎么配置的?正常的应该下面这样

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
        <system.webServer>
            <httpRedirect enabled="true" destination="https://dn.com$S$Q" exactDestination="true" httpResponseStatus="Permanent" />
        </system.webServer>
    </configuration>
    
    
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

问题事件

  • 系统已结题 2月6日
  • 已采纳回答 1月29日
  • 创建了问题 1月29日