Permanent redirecting

tl;dr: Don't use permanent redirects (301) unless you really need them!

When it comes to redirecting, people are often shooting themselves in the foot without realising. In an attempt to save you from trouble, I will go over some options first.

A short overview between the four main redirect status codes:

Permanent Temporary
Allows changing the request method from POST to GET 301 302
Doesn't allow changing the request method from POST to GET 308 307

For a more detailed list of differences between all status codes, visit this stackoverflow thread.

DO use for: Keeping search engine page ranking.

When you publish content on your website, Google and other search engines will index it, and the more popular a page becomes, the higher its ranking in the search results.
This will generate more and more traffic for your website, and thereby often increase revenue.

The problems lies in revising your website. If you want to replace your CMS, or otherwise have something that will involve changing the URL of said page, you can lose its ranking (with all consequences of it).

To avoid losing your ranking, make sure the full old URL redirects to the new URL of the same exact page with a 301 redirect!

Single pages only, page by page. Do not redirect everything to one new page (like the main site URL) or it'll backfire on you. Search engines will, if you did it correctly, update their location of the page and will keep its ranking in place.

Do NOT use for: Site to site redirecting

Do not use "301 Moved Permanently" to redirect from an entire site to one specific new URL (i.e. to You will not be able to undo it properly later as it will be cached forever in browsers, often even after clearing their cache (which you have no remote control over!).

Do NOT use for: http:// to https:// redirecting

The same as with the site to site redirecting above. Do NOT use 301 to redirect from http:// to https://. There is a much better, healthier way. Many search engines, like Google, prefer https:// anyway. So the "Good implementation" example doesn't count when redirecting from http:// to https://!

Use a temporary redirect (302 or 307), combined with setting a HSTS-header on the https://-port instead.

Why? Well, HTTP Strict Transport Security headers: