8 August 2026

Testing HTTP Redirects with curl.exe

Use a HEAD request to see the HTTP status and Location header without downloading the complete page.


When testing a redirect, I usually do not need the HTML page.

I need the HTTP response.

On Windows:

curl.exe -I https://www.example.com

-I requests the response headers.

For a permanent redirect I am looking for something similar to:

HTTP/1.1 301 Moved Permanently
Location: https://example.com/

This is particularly useful when testing:

I also test a non-root path:

curl.exe -I https://www.example.com/articles/test/

If the configuration is correct, the Location header should contain the corresponding destination path.

It is a very small troubleshooting technique, but much clearer than trying to infer redirect behaviour from a browser.