How a 301 works
A visitor asks for an address. Instead of sending a page, the server answers with the code 301 and the address of the replacement. The browser goes there immediately, so the person usually never notices anything happened. The word that matters is permanent: a 301 says the old address is not coming back.
Search engines read that literally. Over time they replace the old URL with the new one in their index, and the reputation the old page had built up — the links pointing at it, the history behind it — is carried across to its replacement. That transfer is not instant and it is not something you can watch happen, but it is the reason a 301 is the standard way to move anything on a website.
You set one on the server, in your CMS, or through a redirect plugin. What matters is that the answer comes from the server before the page loads, not from code inside the page.
Why a 301 matters
It is the difference between moving a page and losing one. Rename a URL without a redirect and every link pointing at the old address, every bookmark and every search result becomes a dead end, and the ranking history goes with it. Set a 301 and the same change costs you almost nothing.
It is also the backbone of every larger change: moving to a new domain, switching to secure addresses, restructuring a site’s folders, or merging two pages that were competing for the same search. Any of those without a mapped set of redirects is how sites lose traffic overnight during a website migration.
Common mistakes with 301 redirects
Sending everything to the homepage is the worst and the most common. Someone deletes a batch of pages, points them all at the front page to avoid errors, and search engines treat those as failures rather than moves, because the homepage is not a replacement for a specific product. A 301 should go to the closest genuine equivalent, or the page should be allowed to disappear properly.
The second is letting redirects stack up. Each redesign adds a hop to the ones already there, and the result is a redirect chain that slows every visit and wastes crawling. Redirects should be rewritten to point at the current destination directly.
The third is using a 302 where a 301 belongs. A temporary redirect tells search engines to keep the old URL, which is the opposite of what you want when the move is final.
How to act on it
Before any restructure, list every URL that exists now and write down where each one goes afterwards. Old address in one column, new address in the other, one line per page, with nothing sent to the homepage unless the homepage really is the equivalent.
Once the change is live, crawl the old list. Every URL should reach a working page in a single hop. Then leave the redirects in place: they are cheap to keep, links from other sites can arrive years later, and removing them is how a migration that went well quietly starts leaking traffic.