wordpress 页面文章为何404?
写了一个单独页面, 在wordpress里, post article 和page 是2个不同的类型, 页面是相对比较独立的内容,可以作为比如about me , 法律信息,一些其它不会有过期的网站信息,同时他也不会出现在你博客的rss中.
今天发现了一个奇怪的问题,新创建的page, 访问他一直是404.我设置了固定链接,通过post访问,可以确定固定链接没有问题,但就是访问page找不到. 但又很奇怪的是,通过后台登陆后,在编辑的页面却可以正常打开该page. 链接一样,但表现让人诧异.
google了一番,有人也提到了这种问题,但没有发现一个好的解决方法.
没有办法,只有亲自抓包对比一下.
1. 直接拷贝链接地址,到chrome的地址栏后,回车访问.
抓到的请求数据为:
GET /%E9%97%B2%E7%BD%AE%E4%B9%A6%E7%B1%8D%E5%87%BA%E5%94%AE/ HTTP/1.1Host: blog.whoistester.comConnection: keep-aliveCache-Control: max-age=0Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
2. 通过后台的页面管理平台,进行查看页面,打开链接后正常打开.它的请求数据包如下:
GET /%e9%97%b2%e7%bd%ae%e4%b9%a6%e7%b1%8d%e5%87%ba%e5%94%ae/ HTTP/1.1Host: blog.whoistester.comConnection: keep-aliveCache-Control: max-age=0Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
发现了问题,但是原因却还是不明白.
如果我拷贝了带有中文字符的链接. 例如我通过wordpress后台, 在chrome中打开了http://blog.whoistester/闲置书籍出售/(如2抓的包), 我再copy这个链接,从地址栏中拷贝, 再新打开一个tab标签页, 粘贴进去地址后, 中文显示还是http://blog.whoistester/闲置书籍出售/, 但是请求则变成了大写字母的urlencode, 则wordpress 返回404.
用英语描述下,希望有高手看到解释下.
I’ve encountered a problem about Wordpress . it’s a weird issue. page 404 notfound , but posts is ok.
Finally I got the reason , but still don’t know how to fix , or maybe there is a bug with chrome browser.
http://blog.whoistester.com/%E9%97%B2%E7%BD%AE%E4%B9%A6%E7%B1%8D%E5%87%BA%E5%94%AE/
if the page name ‘s urlencode is capital letters, the chrome send the request to wordpress , wordpress will respond with 404.
If the page name’s urlencode is small letters, no problem happen. I know it should not be the business of the urlencode letters. But why the same characters (after urdecode string) , made the wordpress having different respond?
此篇文章已被阅读2828 次