检查网站的HTTP头
Hujiuxiang
・1 分钟阅读
$ curl -I amazon.com
说明
使用-I
(大写字母"" )标志,curl
只下载没有内容的页面标题,在上面的例子中:
HTTP/1.1 301 Moved Permanently
Server: Server
Date: Fri, 08 Feb 2019 21:48:23 GMT
Content-Type: text/html
Content-Length: 179
Connection: keep-alive
Location: https://amazon.com/
如果你想跳过重定向,并且获得"真实"内容,可以添加-L
标志,在上面的示例中,amazon.com
将重定向到https://amazon.com
,然后重定向到https://www.amazon.com
。