doutuo2829 2011-10-25 08:21
浏览 83
已采纳

wordpress页面返回404

I have a very strange problem.

The blog has a permalink structure /%category%/%title%/. Everything works fine for posts but when accessing pages by directly typing their URL, I get 404. I noticed this when checking the Google Webmasters Tools. The pages open fine when clicking on their link within the site.

The last thing I should mention is that the titles contain some non Latin characters but they are properly encoded.

Does WordPress check the referrer header and makes some decisions based on its value?

Look at the headers that Firefox sends when accessing the pade directly and it returns 404 and when clicking on internal link:

Host    localhost:8088
User-Agent  Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1
Accept  text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language en-us,en;q=0.5
Accept-Encoding gzip, deflate
Accept-Charset  ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection  keep-alive

Host    localhost:8088
User-Agent  Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1
Accept  text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language en-us,en;q=0.5
Accept-Encoding gzip, deflate
Accept-Charset  ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection  keep-alive
Referer http://localhost:8088/dani/

The only difference is the referer header. Very strange.

  • 写回答

1条回答 默认 最新

  • doxp30826 2011-10-25 15:58
    关注

    The problem turned out to be not in the referer header but in the casing of the utf-8 url parts. The internal links are bult with lower-case letters as:

    http://localhost:8088/dani/%d0%b1%d0%bb%d0%be%d0%b3/
    

    and the page titles have the same look. But when typing a URL in a browser, it encodes the string with upper-case letters as:

    http://localhost:8088/dani/%D0%B1%D0%BB%D0%BE%D0%B3/
    

    which doesn't match the title of the page.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 BP神经网络控制倒立摆
  • ¥20 要这个数学建模编程的代码 并且能完整允许出来结果 完整的过程和数据的结果
  • ¥15 html5+css和javascript有人可以帮吗?图片要怎么插入代码里面啊
  • ¥30 Unity接入微信SDK 无法开启摄像头
  • ¥20 有偿 写代码 要用特定的软件anaconda 里的jvpyter 用python3写
  • ¥20 cad图纸,chx-3六轴码垛机器人
  • ¥15 移动摄像头专网需要解vlan
  • ¥20 access多表提取相同字段数据并合并
  • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
  • ¥20 Java-Oj-桌布的计算