WordPress

Manage 301 redirects in WordPress

Redirect old WordPress URLs correctly: when to use 301 or 302, redirect plugins, .htaccess rules and cPanel Redirects, monitoring 404s and avoiding chains and loops.

IntermediatecPanel hosting3 min read

When you change a page's address, delete a post or restructure your site, old links and search results still point to the old URL. A 301 redirect sends visitors and search engines to the new page and passes on most of the old page's ranking. Without it, they hit a 404 error.

Before you start

  • A list of old and new URLs. After a redesign, export old URLs from your sitemap or Google Search Console before you change anything.
  • Know the difference: 301 is permanent (the normal choice), 302 is temporary (for short-term moves such as a seasonal page).

What WordPress does on its own

When you change a post's slug, WordPress remembers the old one and redirects it automatically. This does not cover pages moved between parents in every case, deleted content, changed permalink structures or URLs from a previous non-WordPress site. For those you need explicit redirects.

Option A: a redirect plugin

  1. Install Redirection (or use the redirect manager in your SEO plugin, if it has one) from Plugins → Add New.
  2. Open Tools → Redirection and complete the short setup.
  3. Click Add New, enter the Source URL as a path such as /old-page/ and the Target URL such as /new-page/.
  4. Keep the HTTP code at 301 - Moved Permanently and click Add Redirect.

The plugin also logs 404 errors, which shows you broken links worth redirecting. Turn off or limit logging on busy sites so the log table does not grow without end.

Option B: .htaccess

Server-level rules are fastest because PHP does not run. Add them above the WordPress block in .htaccess via cPanel → Files → File Manager:

Redirect 301 /old-page/ https://example.com/new-page/
RedirectMatch 301 ^/blog/(.*)$ https://example.com/news/$1

The second line redirects a whole section while keeping the rest of the path. Test every rule; a wrong pattern can redirect your entire site.

Option C: cPanel Redirects

cPanel → Domains → Redirects writes rules into .htaccess for you. It is ideal for redirecting a whole domain to another (for example an old brand domain), with Wild Card Redirect to keep paths.

Which option when

SituationBest option
A few changed pages, editors manage themRedirect plugin
Hundreds of URLs with a pattern.htaccess with RedirectMatch
Old domain to new domaincPanel Redirects with wildcard
HTTP to HTTPScPanel Force HTTPS Redirect

Avoid chains and loops

  • Redirect straight to the final URL. A → B → C chains slow visitors down and dilute ranking signals; update old rules to point to C directly.
  • Never redirect a URL to itself or create circles between rules.
  • Do not redirect every 404 to the home page; search engines treat that as a soft 404. Redirect to the most relevant page or let a genuine 404 show.

Check your redirects

  • Open the old URL in a private window and confirm you land on the new page.
  • Check the status code: in the browser's developer tools (Network tab) the first request should show 301.
  • From a terminal: curl -sI https://example.com/old-page/ shows the status and Location header.

Troubleshooting

  • Redirect ignored: LiteSpeed Cache served a cached page; purge all. Or a more general rule above matches first.
  • Too many redirects: two rules conflict, or a redirect clashes with the HTTPS or www redirect.
  • Query strings lost: use the plugin's option to pass query parameters, or RewriteRule with [QSA].

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.