Choosing the right redirect implementation affects SEO, performance, cache behaviour, and how safely your team can maintain URL changes. This guide compares Apache, Nginx, Cloudflare, and WordPress redirects, with practical examples, precedence rules, testing steps, and a review routine for websites that change over time.
Overview
A URL redirect sends a visitor and their browser from one address to another. The implementation method determines where that instruction runs: on the web server, at the edge of a content delivery network, or inside the application. Each option can be appropriate, but they are not interchangeable.
For a permanent move, use a 301 redirect when the old URL should no longer be used. A 302 redirect is generally suitable for a temporary change, such as a short test or a limited campaign. The status code is only part of the decision: the redirect should also point directly to the correct final URL, preserve relevant path and query-string behaviour, and avoid loops or unnecessary chains.
As a general rule, use the earliest reliable layer that your team can maintain safely. A server-side redirect is usually preferable to an application-level redirect because it can run before WordPress or another content management system loads. An edge redirect can be useful when traffic should be routed before it reaches the origin server. WordPress is convenient when non-technical editors need controlled access, but it adds an application dependency.
Quick platform comparison
- Apache: a good fit where the site already uses Apache and the team can manage virtual-host or
.htaccessrules. - Nginx: well suited to centrally managed server configuration, high-volume sites, and teams comfortable editing and testing configuration files.
- Cloudflare: useful for edge-based forwarding, domain changes, HTTPS routing, and rules that should operate before the request reaches the origin.
- WordPress: practical for smaller sites or editorial teams that need an interface, provided redirects are reviewed and tested like other production changes.
Do not configure the same redirect independently in several layers unless there is a clear reason. Duplicate rules make ownership unclear and can create a redirect chain, conflicting destinations, or a redirect loop.
What to track
A redirect implementation should be monitored as an operational asset, not treated as a one-off line of configuration. Keep a central inventory containing the source URL, destination URL, status code, owner, reason, implementation layer, date added, and review date. For a migration, use a structured website migration redirect map rather than relying on scattered notes or dashboard entries.
Apache redirects
Apache redirects may be placed in server or virtual-host configuration, or in an .htaccess file where the hosting setup permits it. A simple permanent redirect might look like this:
Redirect 301 /old-page/ https://www.example.co.uk/new-page/
For more complex matching, Apache rewrite rules can be used, but test patterns carefully. A rule that is too broad may capture assets, administrative paths, or the destination itself. Configuration changes should be validated before reload, and teams should record whether a rule applies at the server, virtual-host, directory, or .htaccess level. The most local or later rule is not automatically the intended winner, so document the order and scope.
Nginx redirects
Nginx commonly uses a return directive for a straightforward redirect:
location = /old-page/ {
return 301 https://www.example.co.uk/new-page/;
}
A regular-expression location or a broader server block may be appropriate for a pattern migration, but broad matching needs particular care. Nginx location selection follows defined matching rules, so a redirect can be bypassed or unexpectedly selected if another location is more specific. Keep rules grouped by purpose, test the effective configuration, and check both the HTTP and HTTPS server blocks when handling an entire domain.
Cloudflare redirects
Cloudflare can apply redirects at the edge through its available redirect-rule or forwarding features. The exact dashboard labels, limits, and eligibility can change, so confirm the current interface and account capability before planning a large rule set. Typical uses include sending an old hostname to a new hostname, enforcing a preferred HTTPS or host variant, and routing a group of legacy paths.
Edge rules do not remove the need to configure the origin correctly. DNS records, certificate coverage, proxied status, origin redirects, and cache settings can all affect the result. If both Cloudflare and the origin redirect the same request, test the complete path rather than only checking one layer.
WordPress redirects
WordPress redirects can be managed through a redirect plugin, theme or application code, or hosting controls exposed to the site administrator. A plugin is often easier for editorial teams, especially when importing a migration map or reviewing a log of requests to missing URLs. However, plugin rules run after the request reaches WordPress, so they may use more origin resources than a web-server redirect.
Keep redirect logic separate from unrelated plugin settings, restrict editing access, and remove obsolete duplicates. Do not use a redirect plugin to conceal a broken permalink structure indefinitely; investigate the underlying issue and update internal links where appropriate.
Cadence and checkpoints
Review redirect behaviour on a monthly or quarterly cadence, with additional checks after every deployment, domain change, hosting move, permalink change, or major content removal. The review interval should reflect the site's change rate: a frequently updated publication may need more frequent checks than a stable brochure site.
- Check status codes: sample important redirects with a redirect checker or command-line request and confirm the expected 301 or 302 response.
- Check the final destination: confirm that the request reaches the intended canonical URL with no intermediate hop.
- Check chains and loops: identify old URL to temporary URL to final URL sequences, and test for rules that send a request back to itself.
- Check variants: test HTTP to HTTPS, www to non-www or the reverse, trailing-slash choices, uppercase paths where relevant, and common query-string behaviour.
- Check application and edge logs: look for rising requests to removed URLs, unexpected destination patterns, or redirects being served by a different layer than expected.
- Check the inventory: mark rules that are no longer needed, identify missing owners, and record any changes to syntax, limits, or platform configuration.
For a large migration, pair these checks with a redirect migration checklist and test a representative sample before launch. A bulk redirect map should include exact high-value URLs as well as documented pattern rules, not just a list of destination domains.
How to interpret changes
A new 404 after a migration may indicate a missing mapping, an incorrect rule scope, or a request reaching the wrong server block. A 200 response on an old URL may mean the old content still exists, which is not necessarily wrong, but it should match the intended information architecture. A sudden increase in 301 responses can be normal after a domain move; a continuing increase months later may point to outdated internal links or external references.
When a redirect takes two or more hops, fix the chain by changing the original source to the final destination where possible. This makes testing clearer and reduces unnecessary requests. For a detailed diagnostic process, use the guide to finding and fixing redirect chains and loops.
Do not use a redirect to solve every canonicalisation problem. A redirect is appropriate when the old URL should resolve elsewhere; a canonical link can be more suitable when several accessible URLs represent the same content and each may still have a purpose. Review the wider context before choosing between a 301 and 302 redirect, a canonical, or no change.
Changes in campaign traffic also deserve a separate check. UTM parameters can be useful for link tracking, but redirect rules should preserve or intentionally remove query strings according to the campaign design. Test tagged links before publication so that tracking parameters do not trigger an unintended rule or disappear at an intermediate hop.
When to revisit
Revisit this implementation decision whenever you migrate hosting, move from Apache to Nginx, introduce or remove a CDN, change DNS or domain ownership, redesign WordPress permalink settings, or add a new rule-management tool. Also review it quarterly if redirects support important organic landing pages, campaign links, QR codes, or customer-facing domain forwarding.
Before making a change, export or record the current rules, identify which layer currently answers each request, and take a small test sample. After the change, run checks from both the old and new hostnames, verify the status code and final URL, and inspect for chains, loops, cache-related differences, and lost query parameters. Update the redirect inventory and assign a next review date.
The safest platform is the one that matches your operating model: server configuration for centrally controlled, stable rules; edge routing for traffic that should be handled before the origin; and WordPress for managed, editorial changes where application access is acceptable. Whichever method you choose, keep ownership clear, test the complete request path, and remove redundant rules as the site evolves.