You have redesigned your website, renamed a product page or moved to a new domain. Visitors and search engines still have the old addresses saved in bookmarks, links and search results. Without a redirect they hit a "404 Not Found" page, and the rankings you built up disappear. So what is a 301 redirect, how is it different from a 302, and how do you set one up? Here is a clear explanation for site owners.
The short definition
A 301 redirect is a permanent redirect. When a browser or search engine requests the old URL, the server replies with status code 301 Moved Permanently and the new address. The browser loads the new page automatically, usually so quickly the visitor never notices.
For search engines, a 301 is a strong signal to replace the old URL with the new one in results and to pass along the ranking signals the old page had earned, such as links from other websites.
301 vs 302 redirect
The choice comes down to one question: is the move permanent or temporary?
| 301 Moved Permanently | 302 Found (temporary) | |
|---|---|---|
| Meaning | The page has moved for good | The page is elsewhere for now |
| Search engines | Index the new URL | Usually keep the old URL indexed |
| Ranking signals | Passed to the new URL | Stay with the original URL |
| Browser caching | Cached, often for a long time | Not cached by default |
| Typical use | New domain, new URL structure, HTTPS | A/B tests, short promotions, maintenance |
Google has said that it passes ranking signals through both kinds, and that a 302 left in place for months may eventually be treated like a 301. Even so, the right code makes your intent clear and gets the new URL indexed faster. If a "temporary" redirect is still there months later, it is probably permanent – change it to a 301.
For the full family of codes, read HTTP status codes explained.
When to use a 301
- Changing a page's URL or slug – for example, after improving it with the Slug Generator. See what is a URL slug.
- Merging two similar articles into one stronger page.
- Moving from http:// to https://.
- Switching between the www and non-www versions of your domain.
- Rebranding to a new domain name.
- Deleting a product and sending visitors to the closest replacement.
When to use a 302
- Sending visitors to a seasonal or sale page for a few weeks.
- Testing a new version of a page with some users.
- Showing a maintenance page while a section is down.
- Redirecting by location or language when the original URL should stay the main one.
What about 307 and 308?
These newer codes keep the request method the same – a form submitted with POST stays a POST after the redirect.
- 307 Temporary Redirect – the strict version of 302.
- 308 Permanent Redirect – the strict version of 301.
For ordinary web pages, 301 and 302 are fine; 307 and 308 matter mostly for APIs and forms.
How to set up a 301 redirect
On Apache hosting (most shared hosts) add a line to the .htaccess file:
Redirect 301 /old-page https://example.com/new-page
On Nginx, add a rule inside the server block:
location = /old-page { return 301 https://example.com/new-page; }
On WordPress, a plugin such as Redirection, or the redirect manager in an SEO plugin, lets you add redirects without touching code.
On Cloudflare, use Redirect Rules for domain-wide moves such as www to non-www.
In frameworks such as Laravel, add a route redirect: Route::permanentRedirect('/old-page', '/new-page');
Best practices and common mistakes
- Redirect to the most relevant page, not just the home page. Sending everything to the home page can be treated like a "soft 404".
- Avoid redirect chains (A → B → C). They slow pages and waste crawl budget. Point A straight to C.
- Avoid redirect loops (A → B → A) – the browser shows "too many redirects" and the page never loads.
- Update your internal links to use the new URLs directly instead of relying on the redirect.
- Update your sitemap so it lists only final URLs – see what is a sitemap – and point canonical tags at the new address; see what is a canonical URL.
- Keep redirects in place for at least a year, ideally permanently, because other sites may link to the old URL for years.
Test every redirect
After setting up redirects, check them with the free HTTP Status Code Checker. Enter the old URL and it shows each hop, the status code (301, 302, 307 or 308) and where it ends. You want a single hop ending in 200 OK. After a site move, also run the Website Speed Test on key pages – extra redirects show up as slower load times.
The URL Parser helps you spot small differences between similar URLs, such as trailing slashes or query strings, and the Canonical URL Generator helps you tell search engines which version is the main one.
Frequently asked questions
Do 301 redirects lose SEO value? Google has said that properly implemented redirects pass ranking signals. The bigger risks are chains, loops and redirecting to irrelevant pages.
How long does Google take to update after a 301? Usually days to a few weeks, depending on how often it crawls your site.
Is a 302 bad for SEO? Not when the move really is temporary. It only causes trouble when used for a permanent move, because search engines may keep showing the old URL.
Is a meta refresh the same as a redirect? No. Server-side 301 and 302 redirects are faster and clearer to search engines.
Can too many redirects slow my site? Each redirect adds a little time, so avoid chains and update internal links.
Summary
So, what is a 301 redirect? A permanent forwarding instruction that sends visitors and search engines from an old URL to a new one while keeping its rankings. Use a 301 for permanent moves and a 302 for short-term detours, redirect to the most relevant page, avoid chains and loops, and test the result with the free HTTP Status Code Checker.