Skip to content
HTTP 301 Moved Permanently — What It Means & How to Debug

HTTP 301 Moved Permanently — What It Means & How to Debug

DodaTech Updated Jun 20, 2025 4 min read

HTTP 301 Moved Permanently is a redirect response indicating the requested resource has been permanently moved to a new URL — browsers and search engines update their records.

What It Means

The HTTP 301 Moved Permanently status code is a redirect response that tells the client the requested resource now lives at a different URL permanently. When a browser or search engine crawler receives a 301, it updates its bookmarks or index with the new URL and makes all future requests directly to the new location.

The response must include a Location header with the new canonical URL. Most HTTP clients automatically follow 301 redirects without user intervention, though the behavior differs slightly between GET and POST requests.

When It’s Sent

  • Website migration — moving from http:// to https://
  • Domain change — a site moves from oldsite.com to newsite.com
  • URL restructuring — changing the URL slug of a blog post or product page
  • Removing trailing slashes or enforcing a www / non-www canonical domain
  • Redirecting old API versions/v1/users redirects to /v2/users

Real Example

curl -v http://example.com/old-page

Expected response:

> GET /old-page HTTP/1.1
> Host: example.com
>
< HTTP/1.1 301 Moved Permanently
< Location: https://example.com/new-page
< Content-Length: 0
<

The Location header tells the client where to find the resource. Modern browsers automatically follow the redirect and display the new URL in the address bar.

How to Debug

Browser DevTools

  1. Open the Network tab and check Preserve log (redirects clear the log by default)
  2. Load the old URL
  3. Look for a request with status 301 Moved Permanently
  4. Check the Headers tab for the Location field
  5. A second request appears automatically — this is the browser following the redirect

curl

curl -I https://example.com/old-page

The -I (head) flag shows only headers. Look for the Location line. To prevent curl from following the redirect, add -L to follow it or omit it:

curl -s -o /dev/null -w "Status: %{http_code}\nRedirect: %{redirect_url}" \
  https://example.com/old-page

Postman

Disable Automatically follow redirects in Settings to see the 301 response. Enable it to see the final destination. Check the Location header under Headers.

How to Fix

If you encounter an unexpected 301 redirect:

  • Server-side (Nginx): Check for return 301 or rewrite directives in the server block
  • Server-side (Apache): Look in .htaccess for Redirect 301 or RewriteRule directives
  • Server-side (Express/Node.js): Search for res.redirect(301, ...) calls in route handlers
  • Caching: Browsers cache 301 redirects aggressively — clear the browser cache or use curl to bypass it
  • Canonical tags: Check if a CMS or SEO plugin is emitting a 301 via a redirect rule

Common Causes

ScenarioWhat HappensWhy It Matters
HTTP to HTTPS redirecthttp:// requests get 301 to https://Ensures secure connections
Page slug changeold-slug redirects to new-slugPreserves SEO equity
Domain migrationoldsite.com redirects to newsite.comTransfers all traffic to new domain
Trailing slash enforcement/page redirects to /page/Standardizes URL structure
API version deprecation/v1/users redirects to /v2/usersGuides clients to new API version

FAQ

Is 301 the same as 302 for SEO?
No. A 301 passes 90–99% of link equity (PageRank) to the new URL and tells search engines the move is permanent. A 302 does not transfer SEO value — it tells search engines the move is temporary and to keep the original URL indexed. Use 301 for permanent moves and 302 for temporary ones.
Why is my browser not updating the URL after a 301?
Browsers cache 301 redirects aggressively. Clear your browser cache, or use a private/incognito window to see the fresh redirect. On the server side, you can add Cache-Control: no-cache headers during migration testing to prevent caching.
Can a 301 redirect change POST to GET?
Yes. Most browsers and HTTP clients change a POST request to GET when following a 301 redirect. If you need to preserve the HTTP method through a redirect, use 307 Temporary Redirect or 308 Permanent Redirect instead.

Related Codes

  • HTTP 302 Found — temporary redirect, preserves original URL
  • HTTP 307 Temporary Redirect — temporary redirect, preserves HTTP method
  • HTTP 308 Permanent Redirect — permanent redirect, preserves HTTP method
  • HTTP 404 Not Found — what happens when there’s no redirect and the page doesn’t exist

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro