以前作301重定向总是需要寻找301重定向检测网页,如今Linux下的curl命令可以轻松的帮我们查询服务器头信息,告诉我们http返回码
Blinux 更换域名,主机迁移至Godaddy检测时用到了这个查询服务器头信息的命令
1.blinux.cn 重定向到 www.nonabyte.net
[root@Blinux ~]# curl -I blinux.cn
HTTP/1.1 301 Moved Permanently
Date: Wed, 20 Jan 2010 10:11:47 GMT
Server: Apache
Location: http://www.nonabyte.net/
Content-Type: text/html; charset=iso-8859-1
2.www.blinux.cn 重定向到 www.nonabyte.net
[root@Blinux ~]# curl -I www.blinux.cn
HTTP/1.1 301 Moved Permanently
Date: Wed, 20 Jan 2010 10:11:02 GMT
Server: Apache/2.2.3 (Red Hat)
Location: http://www.nonabyte.net/
Vary: Accept-Encoding
Connection: close
Content-Type: text/html; charset=iso-8859-1
3.nonabyte.net 重定向到 www.nonabyte.net
[root@Blinux ~]# curl -I nonabyte.net
HTTP/1.1 301 Moved Permanently
Date: Wed, 20 Jan 2010 10:11:57 GMT
Server: Apache
Location: http://www.nonabyte.net/
Content-Type: text/html; charset=iso-8859-1
4.显示www.nonabyte.net 的http 200 码信息
[root@Blinux ~]# curl -I www.nonabyte.net
HTTP/1.1 200 OK
Date: Wed, 20 Jan 2010 10:12:04 GMT
Server: Apache
X-Powered-By: W3 Total Cache/0.8.5.1
Set-Cookie: PHPSESSID=ee0e895d2a8eec049ed63645df844ecb; path=/
X-Pingback: http://www.nonabyte.net/xmlrpc.php
Set-Cookie: wpgb_visit_last_php-default=1263982326; expires=Thu, 20-Jan-2011 10:12:06 GMT; path=/
Pragma: public
Expires: Wed, 20 Jan 2010 20:12:08 GMT
Last-Modified: Wed, 20 Jan 2010 10:12:08 GMT
Cache-Control: max-age=35999, public, must-revalidate
Vary: Cookie
Etag: dca131344b3df2267c70cd82d77e6db3
Content-Type: text/html; charset=UTF-8
原创文章,转载请注明: 转载自Blinux
原文链接地址: curl命令查询服务器头信息
沙发 先坐下再说
[回复]
Blinux
回复:
一月 20th, 2010 at 7:04 下午
好强大的沙发
[回复]
我也打算把域名移到Godaddy
[回复]
一路同行
回复:
一月 20th, 2010 at 7:05 下午
支持,很多都跑去国外了,续费也不贵
[回复]
CNNIC发现收入剧减,也急了,又想拉拢人心
[回复]
这个深奥。。。暂不研究,哈哈。
怎么注册成为你WordPress的用户呀??
我怎么没找到,是不是我太笨啦。。。
[回复]
Blinux
回复:
一月 21st, 2010 at 8:48 上午
我没有开放注册权限
[回复]
大哥,帮我一个忙。你看我忙活到现在还没睡。

帮我修改一个代码,我才学看不懂。
我把文件传到空间,你下载下来帮我看下好吗?
谢谢!
文件在这里http://www.meesii.info/FlashPicasa.rar
[回复]
大哥还没来呀。。。
[回复]
看你最新那篇文章,会自动转到wap界面去阿。。
[回复]
[回复]
我装的问候访客插件不显示,不知道博主能不能帮我一下。谢谢
[回复]
这是一个很实用的命令哟。
[回复]