All glossary terms
Technical

302 Redirect

A 302 redirect is an HTTP status code indicating a temporary redirect — the original URL should be retained in the search index because the redirect is not permanent.

Use a 302 when the redirect is genuinely temporary: A/B testing, maintenance pages, temporary content relocation, or geo-based redirects. Google will keep the original URL in the index and continue to check it periodically.

A common mistake is using 302 when you mean 301. If the redirect is permanent (URL structure change, content migration), use 301. Using 302 for permanent redirects means Google may keep the old URL indexed and may not transfer full link equity to the new URL, though Google has gotten better at detecting permanent intent behind 302s.

In Next.js, set `permanent: false` in your redirects config for 302 behavior. For middleware-based redirects, use `NextResponse.redirect(url, 302)`. Indxel flags long-lived 302 redirects that should probably be converted to 301s.

Example

// next.config.js — temporary 302 redirect
module.exports = {
  async redirects() {
    return [
      {
        source: "/maintenance",
        destination: "/maintenance-notice",
        permanent: false, // 302 — temporary
      },
    ];
  },
};

// Middleware — dynamic 302 redirect
import { NextResponse } from "next/server";
export function middleware(request) {
  if (isMaintenanceMode) {
    return NextResponse.redirect(new URL("/maintenance", request.url), 302);
  }
}

Related terms

301 Redirect

A 301 redirect is an HTTP status code that permanently redirects one URL to another, telling search engines to transfer ranking signals (link equity) to the new URL.

HTTP Status Codes

HTTP status codes are three-digit numbers returned by a web server in response to a client request, indicating whether the request was successful, redirected, resulted in an error, or failed on the server.

Canonical URL

A canonical URL is an HTML link element that tells search engines which URL is the preferred version of a page, consolidating ranking signals when multiple URLs serve similar content.

Stop shipping broken SEO

Indxel validates your metadata, guards your CI/CD pipeline, and monitors indexation — so you never miss an SEO issue again.

Get startedBrowse glossary
Indxel

SEO validation that runs in your terminal and blocks bad deploys.

GitHubnpm

Product

  • Documentation
  • Pricing
  • Plus Plan
  • CI/CD Guard
  • Indexation
  • Free Tools
  • Blog

Comparisons

  • vs Semrush
  • vs Ahrefs
  • vs Moz
  • vs Screaming Frog
  • All comparisons

Integrations

  • Vercel
  • GitHub Actions
  • Netlify
  • Docker
  • All integrations

Resources

  • Frameworks & use cases
  • Next.js
  • For freelancers
  • For agencies
  • SEO Glossary

Built with care. MIT Licensed.

PrivacyTermsLegalContact