Skip to main content
← All articles
SEOPublished October 7, 20263 min read

301 Redirects When a URL Changes

How to map old URLs to new ones with a 301 so bookmarks, ads, and Google do not land on a 404 after a redesign or permalink change.

RedirectSEOWordPressMigration
On this page

A redesign that changes URLs without a 301 redirect throws away the addresses people already use. Google, old blog posts, WhatsApp links, and ads keep requesting the previous path. If that path is a 404, the visit ends.

A 301 says the move is permanent. Browsers and search engines should follow it and, over time, treat the new URL as the one that matters.

When you need a map

  • WordPress permalinks change from /2020/05/11/judul/ to /blog/judul/.
  • A service page moves from /layanan-kami to /jasa/web/.
  • www and the apex domain should be one site.
  • HTTP should always land on HTTPS.
  • A page is removed and a closer page still answers the same question.

Do not 301 everything to the homepage. That looks like a soft 404. Send each old URL to the closest new page, and only use the homepage when nothing else fits.

How I build the list

  1. Export the old sitemap or crawl the live site before launch.
  2. Write two columns: old path, new path.
  3. Include trailing-slash variants if the server treats them as different URLs.
  4. Keep query strings that matter (campaign links) and drop junk tracking parameters if the stack allows it.

A short list of real URLs beats a clever regex that accidentally redirects the admin area.

Where to put the rule

  • Apache: Redirect 301 /old-path/ /new-path/ or a RewriteRule when the pattern is regular.
  • Nginx: return 301 https://example.com/new-path/; inside the right location.
  • WordPress: a redirection plugin is fine if the host does not let you edit the server config. Prefer server rules when there are hundreds of paths.
  • Static hosts: a _redirects or config file checked into the project so the map survives the next deploy.

Test with the network panel or curl. You want one hop and status 301, not a chain of 302s.

curl -sI https://example.com/old-path/ | head -n 15

Look for HTTP/2 301 and a location header that is already HTTPS and already the final host.

After the cutover

Submit the updated sitemap in Search Console. Leave the old URLs in the redirect map. Removing a 301 a week later brings the 404s back for anyone who has not recrawled yet.

Watch the 404 report for a month. Add a row every time a real old URL shows up that you missed.

Changing the permalink structure rewrites every post URL at once. Export the old links first, switch the structure on staging, generate the map, then deploy the redirects together with the new structure. Doing the switch on production without the map is how a blog disappears from search for a while.

WhatsApp