You have an old URL that needs to point to a new one. Maybe you changed a page slug, restructured your site, or merged content. The concept is simple: when someone visits URL A, send them to URL B.

Setting up a WordPress redirect is straightforward once you understand where the rules live and how they interact. How it actually gets implemented is where things get complicated.

What Is .htaccess?

The .htaccess file is a server configuration file that sits in your WordPress root directory. It controls how your web server (Apache) handles requests before WordPress even loads.

WordPress uses .htaccess primarily for the permalink structure, which provides clean URLs like /about/ instead of /?p=123. But .htaccess can also handle redirects, security rules, and other server-level configurations.

Here's what a typical WordPress .htaccess file looks like:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Everything between # BEGIN WordPress and # END WordPress is managed by WordPress. Don't edit this section manually, as WordPress may overwrite your changes.

Basic Redirect Syntax

To add redirects, place them above the WordPress block:

301 Redirect (Permanent)

Redirect 301 /old-page/ https://yoursite.com/new-page/

A 301 tells browsers and search engines this is a permanent move. Use this for:

  • Pages that have permanently moved
  • Old URLs you want to pass SEO value to new URLs
  • Site restructures

302 Redirect (Temporary)

Redirect 302 /temporary-page/ https://yoursite.com/alternative/

A 302 signals a temporary redirect. Use this for:

  • Maintenance pages
  • A/B testing scenarios
  • Seasonal content swaps

RedirectMatch (Pattern-Based)

For redirecting multiple URLs with a pattern:

RedirectMatch 301 ^/blog/category/(.*)$ https://yoursite.com/articles/$1

This redirects any URL starting with /blog/category/ to /articles/, preserving the remaining path.

Different redirect types in htaccess - permanent 301 and temporary 302 redirects

Common Redirect Patterns

Single Page Redirect

Redirect 301 /services/old-service/ https://yoursite.com/services/new-service/

Entire Directory

RedirectMatch 301 ^/old-section/(.*)$ https://yoursite.com/new-section/$1

Non-WWW to WWW (or Vice Versa)

RewriteEngine On
RewriteCond %{HTTP_HOST} ^yoursite\.com [NC]
RewriteRule ^(.*)$ https://www.yoursite.com/$1 [L,R=301]

HTTP to HTTPS

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

The Redirect Chaos Problem

Here's what we actually see on most WordPress sites: redirect rules scattered across multiple locations with no one keeping track.

Clients understand the concept, "I want this old URL to go to this new URL." But how that gets implemented varies wildly:

  • The Redirection plugin stores rules in the database
  • Yoast SEO automatically creates redirects when you change a slug
  • Developers add rules directly to .htaccess
  • Other plugins modify .htaccess for their own purposes
  • Hosting panels sometimes have their own redirect interfaces

Over time, this creates a mess. We regularly encounter sites where:

  • The same URL has redirect rules in three different places
  • Redirect chains exist: A points to B, B points to C, C points to the actual page
  • Conflicting rules cause different behavior in different browsers
  • Nobody knows which redirects are still needed versus those left over from years ago

The symptoms are frustrating. A redirect works in Chrome but not in Safari. A page loads slowly because it's bouncing through multiple redirects. A "page not found" error appears for a URL that definitely has a redirect somewhere.

Untangling Redirect Chaos

If you suspect redirect conflicts:

  1. Audit your sources: Check .htaccess, your redirect plugin, Yoast's redirect settings, and your hosting panel
  2. Test with redirect checkers: Tools like httpstatus.io show the full redirect chain for any URL
  3. Consolidate: Pick one location for redirects and migrate everything there
  4. Document: Keep a simple spreadsheet of redirects, when they were added, and why

For sites we manage, we maintain redirect documentation and periodically audit for chains or conflicts. It's not glamorous work, but it prevents the slow accumulation of problems.

.htaccess vs. Plugin Redirects

Use .htaccess when:

  • You need server-level performance (redirects happen before PHP loads)
  • You're implementing site-wide rules (HTTPS, www normalization)
  • You're comfortable editing server files

Use a plugin when:

  • Non-technical team members need to manage redirects
  • You want automatic 404 tracking and redirect suggestions
  • You prefer a visual interface over code

Our recommendation: For most organizations, a plugin like Redirection is easier to manage and audit.

The performance difference is negligible for typical redirect volumes. What matters more is that someone can actually see and manage all the redirects in one place.

When .htaccess Redirects Break

Common causes of redirect problems:

Syntax Errors

A single typo can break your entire site. Always:

  • Keep a backup of your working .htaccess
  • Test immediately after changes
  • Know how to access files via FTP if you lock yourself out

Redirect Loops

If A redirects to B and B redirects to A, browsers will eventually give up and show an error. This often happens with:

  • Conflicting www/non-www rules
  • HTTP/HTTPS rules that conflict with other redirects
  • Plugin rules that conflict with .htaccess rules

Redirect loops and other .htaccess syntax errors are common causes of 500 Internal Server Errors.

Trailing Slash Issues

/page and /page/ are technically different URLs. Inconsistent handling causes:

  • Duplicate content issues
  • Redirect loops
  • Broken links

WordPress typically handles this, but custom .htaccess rules can interfere.

Caching

Browsers cache 301 redirects aggressively. If you fix a redirect, but it still seems broken:

  • Clear your browser cache
  • Test in incognito/private mode
  • Try a different browser

This is why we recommend testing redirects in incognito mode during development.

Testing Your Redirects

Before considering a redirect "done":

  1. Test the exact URL including trailing slashes and query strings
  2. Check the redirect type using browser dev tools (Network tab) or an online checker
  3. Verify the destination actually exists and loads correctly
  4. Test in multiple browsers, especially if you've had redirect issues before

When to Get Help

Editing .htaccess directly is powerful but risky. A syntax error can take down your entire site.

If you're not comfortable with server configuration or dealing with redirect chaos accumulated over the years, this is a reasonable place to ask for professional help.

The fix is usually straightforward once someone can see all the redirect sources and untangle the conflicts. What takes a site owner hours of frustration often takes us minutes with the right access and tools.


Dealing with redirect problems? Contact our support team. We can audit your redirects, identify conflicts, and establish a clean system going forward.

This article is part of our WordPress Troubleshooting guide, a complete resource for diagnosing and fixing common WordPress issues.