You need to enable JavaScript to run this app. WordPress首页报404 Not Found且异常重定向丢失8080端口怎么办
优惠活动
大模型
产品
解决方案
定价
更多

WordPress首页报404 Not Found且异常重定向丢失8080端口怎么办

WordPress后台异常重定向导致首页按钮跳转404问题

问题场景

  • 每次点击后台侧栏底部的首页按钮时,页面都会跳转至404 Not Found报错页,相关参考截图包括:
    • WordPress后台仪表盘截图
    • 404报错页面截图
  • 已观察到的异常现象:站点会自动触发重定向,移除访问URL中携带的8080端口。目前已在phpMyAdmin中修改wp_options表的site_url、home_url字段,将值设置为http://localhost:8080/wordpress,但问题仍未解决,暂未定位到触发原因。

日志排查记录

点击首页按钮后,查看浏览器控制台日志,可观察到完整的两步跳转链路:

  1. 首次发起对http://localhost:8080/wordpress/的GET请求,收到由WordPress触发的301永久重定向响应,重定向目标地址为http://localhost/wordpress/,对应日志内容:
    Request URL: http://localhost:8080/wordpress/
    Request Method: GET
    Status Code: 301 Moved Permanently (from disk cache)
    Remote Address: [::1]:8080
    Referrer Policy: strict-origin-when-cross-origin
    Content-Length: 0
    Content-Type: text/html; charset=UTF-8
    Date: Wed, 03 Feb 2021 17:40:28 GMT
    Location: http://localhost/wordpress/
    Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1h PHP/7.4.13
    X-Powered-By: PHP/7.4.13
    X-Redirect-By: WordPress
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
    Accept-Encoding: gzip, deflate, br
    Accept-Language: en-ES,en-US;q=0.9,en;q=0.8
    Connection: keep-alive
    Cookie: wp-settings-1=mfold%3Do; wp-settings-time-1=1612439758; wordpress_test_cookie=WP%20Cookie%20check; wordpress_logged_in_7d02bf5d4e081af2908123233e7fb2e7=Kwsswart%7C1612681149%7C3lzaDUQayIVeJSHGTZiiOEF0IPOnAvdyMTTlSq6SP7Z%7C66c2a42cd2b27d342bd5a234fb1276e73122a06eb9761a76f336f26c5cea485e
    Host: localhost
    Referer: http://localhost:8080/
    sec-ch-ua: "Chromium";v="88", "Google Chrome";v="88", ";Not A Brand";v="99"
    sec-ch-ua-mobile: ?0
    Sec-Fetch-Dest: document
    Sec-Fetch-Mode: navigate
    Sec-Fetch-Site: same-site
    Sec-Fetch-User: ?1
    Upgrade-Insecure-Requests: 1
    User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.104 Safari/537.36
    
  2. 跟随301重定向发起对http://localhost/wordpress/的最终请求,收到404 Not Found响应,对应日志内容:
    Request URL: http://localhost/wordpress/
    Request Method: GET
    Status Code: 404 Not Found
    Remote Address: [::1]:80
    Referrer Policy: strict-origin-when-cross-origin
    Connection: Keep-Alive
    Content-Length: 196
    Content-Type: text/html; charset=iso-8859-1
    Date: Fri, 05 Feb 2021 06:59:33 GMT
    Keep-Alive: timeout=5, max=100
    Server: Apache/2.4.46 (Win64) PHP/7.4.13
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
    Accept-Encoding: gzip, deflate, br
    Accept-Language: en-ES,en-US;q=0.9,en;q=0.8
    Connection: keep-alive
    Cookie: wp-settings-1=mfold%3Do; wp-settings-time-1=1612439758; wordpress_test_cookie=WP%20Cookie%20check; wordpress_logged_in_7d02bf5d4e081af2908123233e7fb2e7=Kwsswart%7C1612681149%7C3lzaDUQayIVeJSHGTZiiOEF0IPOnAvdyMTTlSq6SP7Z%7C66c2a42cd2b27d342bd5a234fb1276e73122a06eb9761a76f336f26c5cea485e
    Host: localhost
    Referer: http://localhost:8080/
    sec-ch-ua: "Chromium";v="88", "Google Chrome";v="88", ";Not A Brand";v="99"
    sec-ch-ua-mobile: ?0
    Sec-Fetch-Dest: document
    Sec-Fetch-Mode: navigate
    Sec-Fetch-Site: same-site
    Sec-Fetch-User: ?1
    Upgrade-Insecure-Requests: 1
    User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like
    
  • 后台设置页参考截图:WordPress后台设置页面截图

内容的提问来源于stack exchange,提问作者Kwsswart_101

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.11.05 15:15:00