301 vs 302 redirects
You have moved a page and need to choose between a 301 and a 302 redirect. A 301 says the move is permanent, a 302 says it is temporary. Both are ordinary HTTP responses, so DNS has resolved and the connection, with TLS for an HTTPS address, is already established before the server answers with a status code and a Location header naming the new URL.
Which one to use: 301 or 302
Use 301 when the old address will not return. Browsers and search engines may remember a permanent redirect and go straight to the new URL next time. Use 302 when the original address stays the main one and the detour is temporary. The memory of a 301 has a side effect: after you change the configuration, your browser may keep following the cached redirect, which makes testing confusing. Test in a private window or with a command-line client.
How to read a redirect chain
Request the page without following redirects automatically, for example with curl -I and the URL, and read the status code and the Location header at every step. Compare the requested hostname, scheme and path with the final URL. Loops break the page, and each unnecessary hop adds latency. For an outside view of the site, use the 2ip site information check.
When the response is an error and not a redirect
A 4xx status generally concerns the request or access to the resource. A 5xx status means the server side failed to handle it, and that side may be a reverse proxy or a CDN in front of the web server. Check DNS and TLS first, then the HTTP response.