3xx RedirectionCommonly usedRFC 9110

301Moved Permanently

Resource has permanently moved to a new URL.

What it means

The requested resource has been permanently moved to the URL in the Location header. Browsers and search engines should update their links. Search engines transfer SEO value (link juice) to the new URL. The method may change from POST to GET on redirect.

When to use it

  • Permanently redirecting old URLs after a site restructure
  • Redirecting HTTP to HTTPS
  • Redirecting www to non-www (or vice versa)
  • Merging duplicate content URLs

Code Examples

Next.js — permanent redirect
typescript
// next.config.ts
export default {
  async redirects() {
    return [
      {
        source: '/old-page',
        destination: '/new-page',
        permanent: true, // 301
      },
    ];
  },
};

Quick Facts

Code301
CategoryRedirection
SpecRFC 9110
CommonYes

Relevant Headers

Location

The new permanent URL

← Back to all status codes