将URL附加为?page_id=-1
然后做一个HTTP HEAD 要求这样做。
在自行安装的WordPress博客上,这将导致404响应。
在wordpress上。com博客,这将导致301响应(如果遵循重定向,则最终得到200响应)。
在非WordPress站点上,您应该得到200个响应(假设没有查询字符串的原始URL给您200个响应)-查询字符串应该没有什么区别。
示例带有HEAD 请求http://blog.stackoverflow.com/2011/03/a-new-name-for-stack-overflow-with-surprise-ending/?page_id=-1
:
HTTP/1.1 404 Not Found
Server: Apache/2.2.9 (Ubuntu) DAV/2 PHP/5.2.6-2ubuntu4.2 with Suhosin-Patch mod_ssl/2.2.9 OpenSSL/0.9.8g
Content-Encoding: gzip
Vary: Cookie,Accept-Encoding
Cache-Control: no-cache, must-revalidate, max-age=0
Last-Modified: Thu, 07 Jun 2012 08:53:01 GMT
Date: Thu, 07 Jun 2012 08:53:01 GMT
Keep-Alive: timeout=15, max=100
Expires: Wed, 11 Jan 1984 05:00:00 GMT
Pragma: no-cache
Connection: Keep-Alive
X-Powered-By: PHP/5.2.6-2ubuntu4.2
X-Pingback: http://blog.stackoverflow.com/xmlrpc.php
Content-Type: text/html; charset=UTF-8
示例带有
HEAD 请求
http://dailycrave.wordpress.com/2012/06/01/three-cheese-grilled-pizza/?page_id=-1
(以下重定向已关闭):
HTTP/1.1 301 Moved Permanently
X-Pingback: http://dailycrave.wordpress.com/xmlrpc.php
Server: nginx
Expires: Wed, 11 Jan 1984 05:00:00 GMT
X-Hacker: If you\'re reading this, you should visit automattic.com/jobs and apply to join the fun, mention this header.
Location: http://dailycrave.wordpress.com/2012/06/01/three-cheese-grilled-pizza/
Pragma: no-cache
Cache-Control: no-cache, must-revalidate, max-age=60
Connection: close
Last-Modified: Thu, 07 Jun 2012 09:01:09 GMT
Content-Type: text/html; charset=UTF-8
Date: Thu, 07 Jun 2012 09:01:09 GMT
(注意X黑客复活节彩蛋!)
如果您按照301重定向到wordpress。com博客,您将得到以下结果:
HTTP/1.1 200 OK
Server: nginx
Vary: Accept-Encoding, Cookie
Last-Modified: Thu, 07 Jun 2012 09:48:26 GMT
Cache-Control: max-age=172, must-revalidate
Connection: close
Date: Thu, 07 Jun 2012 09:50:34 GMT
Transfer-Encoding: Identity
Content-Encoding: gzip
Link: <http://wp.me/pXGqK-27g>; rel=shortlink
X-Pingback: http://dailycrave.wordpress.com/xmlrpc.php
Content-Type: text/html; charset=UTF-8
X-Nananana: Batcache
X-Hacker: If you\'re reading this, you should visit automattic.com/jobs and apply to join the fun, mention this header.
注意“Link”标题包含
http://wp.me/
URL,这似乎是所有wordpress所共有的。com托管的博客,可以用来识别它们。
我相信这是可行的,因为?page_id=-1
在URL中,将覆盖URL段中的默认路由。不会有ID为-1的页面,因此会提供404/重定向。