Summary of status code

expand

301 vs 302, 401 vs 403

Short chain is a 302 jump, why not use a 301?

301 responses are cached by the browser by default. If you look at the status code, you can see from cache. The next time a request is made, the browser will not send the request to the server, but will simply fetch the new address from the cache for redirection.

The first time the browser requests a long link, the next time the browser requests a short link, the browser will not go to the server that requested the short link, but will fetch it directly from the browser cache. One problem with this is that if the server needs to get clicks from the user, if the browser caches long links, the server can’t get clicks from short links, so 301 is usually not used.

301/302 nginx configuration

Rewrite is 301; redirect is 302

401 vs 403

401 is an authentication error and 403 is a permission error.