Check http headers with wget

If you want to see the http headers from your shell, you can do it with:

 

wget --no-check-certificate --server-response --spider https://yourwebsite.something

The result would be something like:

[bash]
Spider mode enabled. Check if remote file exists.
–2014-02-07 11:13:33– https://yourwebsite.something/something
Resolving yourwebsite.something… 129.177.5.226
Connecting to yourwebsite.something|129.177.5.226|:443… connected.
HTTP request sent, awaiting response…
HTTP/1.1 301 Moved Permanently
Date: Fri, 07 Feb 2014 10:13:33 GMT
Server: Apache
Location: https://yourwebsite.something/something/
Vary: Accept-Encoding
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=iso-8859-1
Location: https://yourwebsite.something/something/ [following]
Spider mode enabled. Check if remote file exists.
–2014-02-07 11:13:33– https://yourwebsite.something/something/
Connecting to yourwebsite.something|129.177.5.226|:443… connected.
HTTP request sent, awaiting response…
HTTP/1.1 301 Moved Permanently
Date: Fri, 07 Feb 2014 10:13:33 GMT
Server: Apache
X-Powered-By: PHP/5.3.3
X-Content-Type-Options: nosniff
Vary: Accept-Encoding,Cookie,User-Agent
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Cache-Control: private, must-revalidate, max-age=0
Last-Modified: Fri, 07 Feb 2014 10:13:33 GMT
Location: http://yourwebsite.something/something/index.php/Hovudside
Connection: keep-alive, Keep-Alive
Keep-Alive: timeout=15, max=100
Content-Type: text/html; charset=utf-8
Location: http://yourwebsite.something/something/index.php/Hovudside [following]
Spider mode enabled. Check if remote file exists.
–2014-02-07 11:13:33– http://yourwebsite.something/something/index.php/Hovudside
Connecting to yourwebsite.something|129.177.5.226|:80… connected.
HTTP request sent, awaiting response…
HTTP/1.1 200 OK
Date: Fri, 07 Feb 2014 10:13:33 GMT
Server: Apache
X-Powered-By: PHP/5.3.3
X-Content-Type-Options: nosniff
Content-language: nn
Vary: Accept-Encoding,Cookie,User-Agent
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Cache-Control: private, must-revalidate, max-age=0
Last-Modified: Tue, 14 Jan 2014 11:52:09 GMT
Connection: keep-alive, Keep-Alive
Keep-Alive: timeout=15, max=100
Content-Type: text/html; charset=UTF-8
Length: unspecified [text language="/html"][/text]
Remote file exists and could contain further links,
but recursion is disabled — not retrieving.
[/bash]

Leave a Reply

Your email address will not be published. Required fields are marked *