HTTP headers are information passed between a web browser and a website when it's visited. These headers contain information you can use to add or confirm if a service is active on your website such as CORS, Security headers, or Cloudflare.
This article explains the different ways you can view your website's HTTP Headers.
The easiest way to view your website's headers is to use a 3rd party website. Just visit the site and enter your website URL. You most often are looking for the Response headers.
You can also use the tools built into your browser to view the headers. The steps are the same in Chrome, Firefox, and Safari as shown below.
Chrome, Firefox, and Safari
- Open the Developer Tools menu in your browser.
Windows: Hold down CTRL + SHIFT and press the letter i. You could also right-click the page and select Inspect from the menu.
Mac: Hold down Option () + Command () and press the letter i. You could also right-click (Ctrl ()+ click) the page and select Inspect from the menu.
- Click the Network tab in the Dev Tools menu.
- Reload the page you're currently on by clicking the refresh button in your browser, or by pressing F5. A list of all files loaded on the current page displays.
- Click any file under the Name column.
- Select the Headers tab in the right pane.
- The HTTP Headers display in the right pane.
They are separated into Response Headers and Request Headers. You most often want to view the Response Headers.
The final option is to run a command in a shell terminal. You will need access to a terminal in order to run the following commands.
Mac and Linux
Mac and Linux computers already have a Shell terminal built-in.
Windows users can download PowerShell.
You could also run the command by logging into your DreamHost server via SSH.
Display the response headers of a website
Run the curl command with the -I flag to display the response headers of a website.
[server]$ curl -I https://example.com HTTP/2 200 accept-ranges: bytes age: 416502 cache-control: max-age=604800 content-type: text/html; charset=UTF-8 date: Tue, 11 May 2021 15:05:33 GMT etag: "3147526947" expires: Tue, 18 May 2021 15:05:33 GMT last-modified: Thu, 17 Oct 2019 07:18:26 GMT server: ECS (sec/9795) x-cache: HIT content-length: 1256
Download PowerShell to your Windows computer. You can then run the following command to view a website's headers.
PS C:\Users\username> Invoke-WebRequest -Uri https://example.com -UseBasicParsing | Select-Object -ExpandProperty Headers Key Value --- ----- Age 357194 Vary Accept-Encoding X-Cache HIT Content-Length 1256 Cache-Control max-age=604800 Content-Type text/html; charset=UTF-8 Date Mon, 10 May 2021 23:26:34 GMT Expires Mon, 17 May 2021 23:26:34 GMT ETag "3147526947+ident" Last-Modified Thu, 17 Oct 2019 07:18:26 GMT Server ECS (dcb/7EEA)
Analysis of header output
The header information you retrieve can often be difficult to understand. View the following links for explanations of the different fields you may see.