शब्दकोश · नेटवर्किंग

Redirect (301 vs 302)

A 301 redirect marks a move as permanent and a 302 marks it as temporary; the choice affects caching, link signals and how search engines treat the old URL.

अपडेट: अक्टूबर 5, 2026

An HTTP redirect is a 3xx response with a Location header that sends the client to a different URL. A 301 Moved Permanently says the resource has moved for good; a 302 Found says the move is temporary and the original URL should still be used later.

Why it matters

Browsers cache 301s aggressively, and search engines treat them as a signal to consolidate to the new URL. A 302 keeps the old URL as the canonical one. Choosing wrongly can leave the wrong page indexed or trap users on an old cached redirect. Chains and loops add latency and can cause ERR_TOO_MANY_REDIRECTS.

Example

HTTP/1.1 301 Moved Permanently
Location: https://www.example.com/pricing

For methods other than GET, the older codes allow clients to change a POST into a GET. 307 (temporary) and 308 (permanent) preserve the method and body, so use them for API redirects.

return 301 https://www.example.com$request_uri;

Common mistakes

  • Redirecting everything to the homepage instead of the equivalent page.
  • Building chains such as http to https to www to a new path. Redirect straight to the final URL.
  • Testing a 301 in your browser, which has cached it, and not in a clean client such as curl -I.
  • Using a permanent redirect for a short-term campaign page.

Get notified when this term updates

Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.

यह पेज सामान्य जानकारी है, जिसे हमारी संपादकीय टीम ने लिखा है और दस्तावेज़ीकरण बदलने पर अपडेट किया जाता है। सर्वर और प्रदाता अलग-अलग होते हैं, इसलिए बदलाव पहले सुरक्षित तरीके से जाँचें। देखें: संपादकीय नीति और अस्वीकरण.