↑ ↓ select, Enter open, Esc close

Follow and show the redirect chain of a URL

Adjust the values, the command updates live
user@server
curl -sSIL http://example.com/ | grep -iE '^(HTTP/|location:)'

Follows all redirects with -L and shows the status line and the target from the location header for each hop. This reveals double redirects, for example first to https and then to www, which are better handled in one step. In an endless loop, curl gives up after 50 redirects.

Also searched as

  • check redirect chain curl
  • too many redirects debug
  • http to https www redirect test

Related one-liners

All in Network

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.