以前作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命令查询服务器头信息

随机日志

16 Responses to “curl命令查询服务器头信息”

  1. 一路同行 CHINA Internet Explorer Windows 说:

    沙发 先坐下再说 :mrgreen:

    [回复]

    Blinux AUSTRALIA Mozilla Firefox Fedora Linux 回复:

    好强大的沙发 :mrgreen:

    [回复]

  2. Firm CHINA Internet Explorer Windows 说:

    我也打算把域名移到Godaddy

    [回复]

    一路同行 CHINA Internet Explorer Windows 回复:

    支持,很多都跑去国外了,续费也不贵

    [回复]

  3. zhukun CHINA Mozilla Firefox Windows 说:

    CNNIC发现收入剧减,也急了,又想拉拢人心 8-O

    [回复]

  4. MeeSii CHINA Internet Explorer Windows 说:

    这个深奥。。。暂不研究,哈哈。

    怎么注册成为你WordPress的用户呀??
    我怎么没找到,是不是我太笨啦。。。

    [回复]

    Blinux AUSTRALIA Google Chrome Linux 回复:

    我没有开放注册权限 :lol:

    [回复]

  5. MeeSii CHINA Internet Explorer Windows 说:

    大哥,帮我一个忙。你看我忙活到现在还没睡。 :cry:
    帮我修改一个代码,我才学看不懂。 :-?

    我把文件传到空间,你下载下来帮我看下好吗?
    谢谢!
    文件在这里http://www.meesii.info/FlashPicasa.rar

    [回复]

  6. MeeSii CHINA Internet Explorer Windows 说:

    大哥还没来呀。。。 :?:

    [回复]

  7. 柳城 CHINA Internet Explorer Windows 说:

    看你最新那篇文章,会自动转到wap界面去阿。。 :evil:

    [回复]

  8. 永锋 CHINA Internet Explorer Windows 说:

    我装的问候访客插件不显示,不知道博主能不能帮我一下。谢谢

    [回复]

  9. 吻火 CHINA Mozilla Firefox Windows 说:

    这是一个很实用的命令哟。

    [回复]

  10. swappy CHINA Google Chrome Windows 说:

    最近研究CURL,毫无头绪

    [回复]

  11. Finys CHINA Mozilla Firefox Linux 说:

    第一次使用这个命令,又学到了一个..

    [回复]

Leave a Reply

:wink: :-| :-x :twisted: :) 8-O :( :roll: :-P :oops: :-o :mrgreen: :lol: :idea: :-D :evil: :cry: 8) :arrow: :-? :?: :!: