Changing a published URL without a 301 redirect means losing your rankings and backlinks overnight. This guide covers when to redirect, how link equity transfers, and the exact syntax for Apache, Nginx, and Next.js.
Every time you change a published URL, you risk losing the search rankings and backlinks the original page has earned. A 301 redirect is the mechanism that prevents that loss — it tells search engines and browsers that a page has moved permanently, and passes virtually all of the original page’s link authority to the new URL.
This guide explains when to use a 301 redirect, how link equity transfers work, and how to implement redirects correctly in Apache, Nginx, and Next.js.
A 301 is an HTTP status code that means “Moved Permanently.” When a browser or search engine crawler requests a URL that has a 301 redirect, the server responds with the new URL and the client automatically follows it. Google treats a 301 as a strong signal that the old URL should be replaced in its index by the new one.
The number 301 refers to the HTTP status code, as opposed to a 302 (temporary redirect) or 307 (temporary redirect with method preservation). Using the wrong redirect type is a common mistake: a 302 tells Google the move is temporary, so it keeps the old URL in its index rather than transferring authority to the new one.
You need a 301 redirect any time you change the URL of a published page that:
If a page has never been indexed and has no external links, you can safely change its URL without a redirect. In practice, if a page has existed for more than a few days, adding a redirect is the safer choice.
Google estimates that a 301 redirect passes approximately 99% of the original page’s PageRank to the destination URL. The ranking signals accumulated by the old URL — its backlinks, click-through history, and engagement signals — transfer to the new one almost completely.
However, redirect chains multiply crawl overhead significantly. If you have a chain like A → B → C, consolidate it to a single redirect from A → C. Google will follow chains up to five hops, but link equity degrades slightly at each hop and crawl efficiency suffers.
Add the following line to your .htaccess file, replacing the old and new paths:
Redirect 301 /old-slug /new-slug
For rewriting URL patterns with mod_rewrite:
RewriteRule ^old-slug/?$ /new-slug [R=301,L]
Add a return directive inside your server block:
location = /old-slug {
return 301 /new-slug;
}
Next.js handles redirects in the redirects array in next.config.js:
module.exports = {
async redirects() {
return [
{
source: '/old-slug',
destination: '/new-slug',
permanent: true,
},
];
},
};
Setting permanent: true emits a 301; permanent: false emits a 302. The SlugGenius Redirect Generator outputs the correct syntax for all three formats automatically — paste in your old and new URLs and copy the ready-to-use redirect rule.
After implementing a redirect, verify it with one of these methods:
curl -I https://example.com/old-slug and confirm the response is HTTP/1.1 301 with a Location header pointing to the new URL.Getting redirects right is a one-time cost that protects the SEO investment you have already made in your existing pages. Use the Redirect Generator to eliminate the guesswork on syntax, and implement the redirect the same day you change any published slug.
No sign-up required — use them instantly in your browser.