On this page
What is a 301 redirect?
A 301 redirect is the server's way of saying "this page lives somewhere else now, and it is not coming back." The status code is 301 Moved Permanently, defined in the HTTP standard (RFC 9110).
Visitors barely notice it. They click an old link and land on the new page a moment later. Search engines pay close attention to it: a 301 is a strong signal to drop the old URL from the index, show the new one instead and move its ranking signals over.
That makes the 301 the default tool whenever a URL changes for good. A page that moves without one leaves a 404 behind, and every bookmark, backlink and search result pointing to it breaks.
How does a 301 redirect work?
A redirect is a short exchange between the browser and the server. Here is what happens when someone opens an old URL:
- The browser requests the old URL
It sends a normal GET request for the address in the link or bookmark.
- The server answers with status 301
Instead of the page, it returns "301 Moved Permanently", usually with an empty or tiny body.
- The Location header names the new address
This response header holds the URL the browser should go to next.
- The browser makes a follow-up request
It requests the Location URL on its own and shows that page. The address bar updates to the new URL.
The server's response looks like this:
HTTP/1.1 301 Moved Permanently
Location: https://example.com/new-page
Content-Length: 0Because the move is permanent, browsers are allowed to cache a 301. Next time, the same visitor's browser may jump straight to the new URL without asking the server at all. That is good for speed, but it becomes a trap if you set the wrong target, as shown below.
301 vs 302, 307 and 308: which redirect should you use?
There are four common redirect codes. They differ on two points: whether the move is permanent, and whether the browser must keep the original request method (for example, a form POST).
| Code | Meaning | Permanent? | Keeps the request method? | Typical use |
|---|---|---|---|---|
| 301 | Moved Permanently | Yes | Not guaranteed, POST may become GET | Moved pages, domain changes, HTTP to HTTPS |
| 302 | Found | No | Not guaranteed, POST may become GET | Short detours, such as a sale page or maintenance notice |
| 307 | Temporary Redirect | No | Yes | Temporary moves of endpoints that receive forms or API calls |
| 308 | Permanent Redirect | Yes | Yes | Permanent moves of endpoints that receive forms or API calls |
Ordinary web pages are fetched with GET, so the method question does not matter for them. Pick 301 when the move is permanent and 302 when you plan to bring the old URL back. Use 308 or 307 when the URL receives POST requests and the method must survive the redirect.
According to Google's guide to redirects and Google Search, 301 and 308 are strong signals that the target should become the indexed URL, while 302 and 307 are weak signals.
When should you use a 301 redirect?
Use a 301 whenever an old URL should stop existing but you don't want to lose its visitors and links. There are four everyday cases:
Moving your site to a new domain
Redirect every old URL to the matching page on the new domain, not everything to the new home page. Sending everything to the home page throws away what each individual page was relevant for. If the move also changes DNS, expect the switch to take a while; our guide to DNS propagation explains why.
Switching from HTTP to HTTPS
Once your certificate works, send every http:// request to the same path on https:// with a 301. Also pick one host version (with or without www) and redirect the other to it, so each page has exactly one address.
Renaming a page URL or slug
Changed /blog/seo-tips-2023 to /blog/seo-tips? Redirect the old slug to the new one so links shared on social media and other sites keep working.
Merging two pages into one
When you combine thin or overlapping articles, redirect each retired URL to the page that now covers its topic. Choose the closest match so visitors land on content that answers what they came for.
When not to use a 301: if a page is gone and nothing replaces it, let it return 404 or 410. Redirecting deleted pages to an unrelated page confuses visitors, and Google may treat it as a soft 404 anyway.
How to set up a permanent redirect on your server
Most sites set up redirects in the web server config, a CMS plugin or the hosting dashboard. Here are minimal examples for the two most common servers:
Send all HTTP traffic to HTTPS with a 301:
server {
listen 80;
server_name example.com www.example.com;
return 301 https://example.com$request_uri;
}Redirect one renamed page inside your HTTPS server block:
location = /old-page {
return 301 /new-page;
}Redirect one renamed page in .htaccess or the virtual host config:
Redirect 301 /old-page https://example.com/new-pageSend all HTTP traffic to HTTPS with mod_rewrite:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]If you are unsure about a new rule, test it with a 302 first. Browsers cache a 301, so a wrong permanent redirect can stay in visitors' browsers even after you fix the server.
Common 301 redirect mistakes
Redirect chains
Chains build up as redirects are added over the years. The old HTTP URL redirects to HTTPS, which redirects to www, which redirects to the renamed slug:
Each hop adds a round trip before the page starts loading, and crawlers stop following after a limited number of hops. To fix a chain, point each old URL straight at the final address in one step.
Redirect loops
A loop is a chain that never ends: page A redirects to B and B redirects back to A. Browsers give up and show an error such as "too many redirects". Loops often come from two layers working against each other, for example a CDN that forces HTTP while the server forces HTTPS.
Redirects that end on a 404
Here the redirect itself works, but the target page was later deleted or the address was mistyped. The visitor still lands on an error, and the redirect passes nothing useful. Recheck your targets after every site restructure.
Update your own links too. A redirect is a safety net, not a replacement for fixing links. Change internal links, menus, canonical tags and your sitemap to the new URLs so your own site never sends visitors through a redirect.
How to check a 301 redirect and where it ends up
The Pingie link checker follows each URL through all of its redirects and reports where it lands. For every link you get:
- Final URL: the address the redirects end on.
- Redirect count: how many hops it took. One is fine; two or more means a chain you should flatten.
- Final status code: 200 means the destination works, while a 404 or 5xx means the redirect ends on a broken page.
Use single URL mode to check one redirect, batch mode to paste a list of old URLs after a migration, or sitemap mode to check the URLs listed in a site's sitemap.
Where does your old URL end up?See the final URL, redirect count and status codeThe HTTP headers checker also follows redirects. It shows the status code and full response headers of the page the redirects end on, so you can confirm the destination is set up properly. For example, you can check that your new HTTPS address sends a Strict-Transport-Security header.
To see the 301 response itself, including its Location header, request the old URL without following redirects. From a terminal:
curl -I http://example.com/old-pageAdd -L to make curl follow the redirects and print the headers of each hop. The MDN reference for 301 covers the status code in more detail.
Ready to check your redirects?
- Find the final URL behind every old link
- Spot chains by their redirect count
- Catch redirects that end on a 404
Frequently asked questions
Yes. Google treats a 301 as a strong signal that the new URL should replace the old one in search results, and ranking signals such as links are consolidated on the target. This works best when the new page covers the same topic as the old one rather than something unrelated.
A 301 says the move is permanent, so search engines index the new URL and browsers may cache the redirect. A 302 says the move is temporary, so search engines usually keep the original URL indexed. Use 301 when the old address is gone for good and 302 when it will come back.
Google recommends keeping redirects for at least a year, and longer is safer. Old links on other sites, bookmarks and emails keep sending visitors for years. A redirect costs almost nothing to maintain, so many sites keep theirs indefinitely, especially after a domain move.
Yes. Each hop adds a round trip before the page loads, which slows visitors down, especially on mobile. Crawlers stop after a limited number of hops, so pages at the end of long chains may not be indexed. Point every old URL straight to its final address in one step.
Enter the URL in the Pingie link checker. It follows every redirect and shows the final URL, the number of redirects and the final status code. To see the raw 301 response with its Location header, run curl -I on the old URL in a terminal, which does not follow redirects.