A 301 redirect tells browsers and search engines that a URL now lives permanently at a new address. After that, Google usually shows the target in its search results.
- For Google, 301 and 308 are permanent, while 302, 303 and 307 are temporary.
- Google’s crawlers follow up to ten redirects in a row, but Google recommends going straight to the target.
- After a site move, Google says the redirects should generally stay in place for at least one year.
- WordPress redirects a changed slug on its own for posts, while the function in charge does not try this for pages.
Setting up a 301 redirect is usually quick, and the mistakes only happen afterwards: on the second and third change to the same URL, during a move with hundreds of old addresses or with a WordPress slug that someone shortens in passing. Then three redirects hang in a row or everything ends up on the homepage.
This guide sticks to Google’s own documentation and to the HTTP standard. You will not find the percentages of “passed-on link equity” quoted in some guides here, because there is no primary source for them. A redirect steps in where Google crawls and indexes: when the old address is fetched and when the URL for the index is chosen.
What a 301 redirect is
A 301 redirect is a server response with the HTTP status code 301 “Moved Permanently” and the new address in the Location header. The RFC 9110 standard describes the code like this: the resource has a new permanent URI and future references ought to use the new address. Browsers usually follow the redirect automatically and visitors barely notice it.
For Google Search the code has two consequences. Googlebot follows the redirect, and Google’s indexing treats it as a signal that the target should become the canonical URL. That is why the new target appears in the search results. In Google’s list of canonicalization methods the redirect sits at the top as a strong signal, ahead of the canonical tag and the sitemap.
Google names typical reasons itself in its documentation on redirects: moving to a new domain, several addresses for the same homepage, merging two websites and a removed page with a successor.
301, 308, 302 or 307: which code when
Google sorts the codes into two groups by duration. 301 and 308 count as permanent and the target appears in search. The HTTP status code 302 counts as temporary, as do 303 and 307. Then the old source page stays in the search results and the redirect does not count as a signal for the target.
| Code | Meaning per RFC 9110 | How Google treats it | Use |
|---|---|---|---|
| 301 | Moved Permanently, client may turn POST into GET | permanent, target in search | site move, new slug, merged pages |
| 308 | Permanent Redirect, method stays | permanent, target in search | permanent redirect of form or API endpoints |
| 302 | Found, client may turn POST into GET | temporary, source stays in search | short detour, for example during maintenance |
| 307 | Temporary Redirect, method stays | temporary, source stays in search | temporary detour with form data |
The difference between 301 and 308 appears as a note in the standard. For historical reasons a browser may switch the request from POST to GET on a 301. If you do not want that, RFC 9110 says to use 308 instead. For a normal article page this does not matter because it is fetched with GET, but for a form whose target address moves it very much does.
Besides the status code there are two more ways out of the HTML. Google treats a meta refresh with zero seconds as permanent and a delayed one as temporary. According to Google you should only use JavaScript redirects if neither a server-side redirect nor a meta refresh is possible. Server-side redirects have the best chance of being interpreted correctly by Google.
Setting up a 301: Apache, nginx, PHP
Apache. The simplest form comes from the mod_alias module and works in the .htaccess. According to the Apache docs, the keyword permanent returns status 301:
Redirect permanent "/old-article/" "https://www.example.com/new-article/"
There is a trap in the matching. Redirect only compares the start of the path in complete path segments and Apache appends whatever comes after the matched part to the target. So if you redirect /blog, every address below it lands at the new location with its old remainder attached. For exact matches there is RedirectMatch with regular expressions, or mod_rewrite.
nginx. Here the return directive stops processing and sends the specified code to the client:
location = /old-article/ {
return 301 https://www.example.com/new-article/;
}
PHP. Without access to the server configuration you set a 301 redirect in PHP directly in the old file. Google shows the header() function for this, and it has to come before any output:
header('HTTP/1.1 301 Moved Permanently');
header('Location: https://www.example.com/new-article/');
exit();
curl -I https://www.example.com/old-article/. The response has to show the line with 301 and below it the correct Location. Browsers may cache a 301 response. A test in the browser may then show you an old state.
Changing a slug in WordPress: when core redirects
WordPress does not always need a plugin for this, because core already ships its own redirect for changed slugs. The function wp_old_slug_redirect() looks for the current post among the past slugs when an address finds nothing and redirects there with status 301.
The gap is right in the function’s source code. WordPress does not attempt this redirect for hierarchical post types. Pages are registered as hierarchical in WordPress. So when you shorten the slug of a page like “Services”, this redirect does not kick in. Whether the old address still ends up somewhere depends on other functions and plugins. Do not rely on it and set up your own redirect for pages, in the server configuration or with a redirect plugin.
In my view this is why a separate look at the pages pays off after a relaunch. The posts look clean because core catches them. A missing redirect on a page may only show up among the 404 errors in Search Console. Internal links to the old address are then broken links in WordPress and belong on the new address.
Redirect chains: ten hops allowed, few recommended
A chain forms when a URL redirects to a second one that redirects again. This can creep in over the years: first the switch to HTTPS, then a new folder structure, then a new slug. Each change was right on its own and together they add up to three hops.
Google states the limit in its crawling documentation: by default, Google’s crawlers follow up to ten redirect hops. That is the technical ceiling and not a recommendation. In the guide to site moves Google recommends redirecting directly to the final destination. If that is not possible, the chain should ideally have up to three and at most four redirects. As the reason, Google names the extra latency for users and the fact that some browsers and user agents cannot handle long chains.
The fix is simple in principle. Every old address points directly to today’s target and the stops in between drop out of the chain. On large websites this saves fetches and with them crawl budget.
Site moves: target, duration, internal links
The target. Google advises against pointing many old URLs at a single unrelated page, for example the new homepage. That can confuse visitors and may be treated as a soft 404 error. It is a different story for several old pages that you merged into one new page. Then all old addresses may point to that page. Which pages to merge or delete is something a content audit with pruning settles before the move.
The duration. Google writes: “Keep the redirects for as long as possible, generally at least 1 year.” During that time Google has the opportunity to move all signals over to the new URLs, including links from other websites to your old addresses. From the user’s point of view, Google suggests considering keeping the redirects indefinitely.
Your own links. Every redirect costs time when a page loads, so Google recommends switching the website’s internal links to the new addresses after the move as well. The same goes for canonical tags and hreflang annotations. They also have to point to the new URLs after the move.
Redirect or canonical
Both tell Google which URL belongs in the index, and Google rates the redirect just like the canonical tag as a strong signal. The difference lies with the visitor. A redirect sends everyone to the new address. The canonical tag leaves the page in place and only gives Google a hint. In my view that fits filter and tracking parameters and not a real move.
Frequently asked questions (FAQ)
What is a 301 redirect?
A 301 redirect is a server response with the status code 301 “Moved Permanently”. It reports that a URL has a new permanent address. Browsers usually follow it automatically and Google then shows the target in its search results.
What is the difference between 301 and 302?
301 is permanent, 302 temporary. With 301 Google shows the target in its search results. With 302 the old source page stays there.
When is 308 better than 301?
When the old address receives form data via POST. With 301 a browser may turn POST into GET according to RFC 9110. With 308 the method stays the same. For Google both are permanent.
How many redirects in a row does Google follow?
By default Google’s crawlers follow up to ten redirects. Google still recommends redirecting straight to the target and otherwise chaining at most four redirects.
How long does a 301 redirect have to stay in place?
According to Google for as long as possible and generally at least one year. For visitors it is best to keep the redirect in place for good.
Conclusion: plan first, then redirect
The technical part is usually quick, and the difference comes from the list before it with three questions: Which old address points to which new one? Does a chain form? Does the page have a real counterpart? This list is the actual work, the server rule only the last step.
Sources (retrieved on 23 October 2026)
- Google Search Central: Redirects and Google Search
- Google Search Central: Site moves with URL changes
- Google Crawling Infrastructure: HTTP status codes, network and DNS errors
- Google Search Central: How to specify a canonical URL
- IETF: RFC 9110, HTTP Semantics
- Apache HTTP Server: mod_alias
- nginx: Module ngx_http_rewrite_module
- WordPress Developer Resources: wp_old_slug_redirect()
As of: October 2026. All information without guarantee; despite careful research no warranty is given as to topicality or completeness. No individual consulting. Information on Google, Apache, nginx and WordPress is based on their published documentation, for whose accuracy no guarantee is given. Technical details reflect the state documented on the retrieval date and may change. All brand and product names mentioned are the property of their respective owners.


