WordPress redirect performance comparison showing a slow PHP-based redirect and a faster Apache server-level redirect.

Moving redirects to Apache can eliminate one to two seconds of unnecessary WordPress processing.

Technical Solutions / Performance Engineering

How to Save 1–2 Seconds on WordPress Redirects by Bypassing PHP

One or two seconds is an eternity in website loading time — long enough for a potential customer to lose patience and leave. Yet one surprisingly common source of unnecessary delay is also one of the easiest to fix: WordPress processing redirects that the web server could handle directly.

1.47–1.99 s Observed WordPress redirect timings
42.1 ms Server-level redirect TTFB
Historical observations from live commercial websites hosted on our managed VPS during November 2026. These are individual production measurements, not controlled benchmark averages or a matched statistical comparison.

Moving predictable redirects to the web-server layer removes unnecessary PHP processing and can substantially reduce the time visitors spend waiting for redirected requests. The actual saving depends on the hosting environment and application workload.

Three lines of configuration. No additional plugins. No hosting upgrade.

01 / Diagnosis

Is WordPress Handling Your Redirects?

Finding out takes only a few seconds. Open Windows PowerShell and run the following command, replacing example.com with your own website domain.

Diagnostic command
curl.exe -s -o NUL -D - https://www.example.com/
Actual response — anonymised customer website, November 2026
HTTP/1.1 301 Moved Permanently
X-Powered-By: PHP/8.3.37
X-Redirect-By: WordPress
Location: https://example.com/

Problem identified. PHP and WordPress are being invoked simply to issue a redirect — a task the web server can perform directly.

02 / Implementation

Move the Redirect to the Web Server

On an Apache or compatible web server, locate the .htaccess file in the website's document root and make a backup. Add the following rule above the WordPress rewrite block, replacing example.com with your own domain.

Apache .htaccess configuration
# Canonical non-www redirect
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
RewriteRule ^ https://example.com%{REQUEST_URI} [R=301,L]

This assumes your preferred website address is HTTPS without www. The web server now returns the permanent redirect before WordPress is loaded.

01
No PHP invocation
02
No WordPress initialisation
03
No WordPress database queries

The original URL path and query string are preserved. Existing links, campaign tracking parameters and search engine references continue to function.

03 / Verification

Verify the Result — Never Assume

Repeat the diagnostic test, this time including a valid page path and a query string to confirm that neither is lost during the redirect.

PowerShell verification
curl.exe -s -o NUL -D - "https://www.example.com/ai-observatory/?test=1"
Actual response after implementation — anonymised
HTTP/1.1 301 Moved Permanently
Content-Type: text/html
Content-Length: 795
Location: https://example.com/ai-observatory/?test=1
✓ Permanent 301 redirect
✓ Correct canonical hostname
✓ Original URL path preserved
✓ Query string preserved
✓ PHP response header eliminated
✓ WordPress redirect header eliminated

Verification successful. The server-level rule is now handling the redirect without invoking WordPress, while preserving the original request parameters.

04 / Wider Performance Benefits

Small Change. Significant Impact.

Saving a second or two on an individual redirect is valuable enough. But on a busy website, eliminating thousands of unnecessary PHP invocations can also reduce competition for server resources.

Visitors

Less waiting before the requested page begins loading, particularly when following older links.

Hosting

Fewer unnecessary PHP requests and more processing capacity available for genuine application workloads.

AI & Search

Faster redirect responses for automated crawlers accessing non-canonical URLs.

This is particularly relevant to large WooCommerce websites, where automated systems can request thousands of product and category URLs and repeatedly trigger redirects.

Before paying for more server capacity, make sure you are not wasting the capacity you already have.
05 / Frequently Asked Questions

WordPress Redirect Performance FAQ

Will moving redirects to Apache affect my SEO?

No adverse SEO impact is expected when the destination URL, permanent 301 status and request parameters remain unchanged. Search engines receive the same redirect instruction, but without the unnecessary WordPress processing delay.

Will this make every page load faster?

The direct time saving applies to requests that trigger the optimised redirect. However, reducing unnecessary PHP processing can also free server resources for other requests, particularly on busy or resource-constrained websites.

Can I move other WordPress redirects to Apache?

Yes. Predictable redirects involving canonical hostnames, trailing slashes and permanent URL changes are often suitable for server-level implementation. Each rule should be tested carefully to prevent redirect loops or unintended changes to legitimate URLs.

Do I need a plugin or a more powerful hosting plan?

No. On an Apache or compatible hosting platform supporting .htaccess rewrite rules, this optimisation requires only a small configuration change.

06 / References

Technical Evidence & Further Reading

Original Engineering Investigation Are AI Bots Slowing Down Websites? A Real Case Study

Our original VPS investigation, including measured redirect performance, PHP processing overhead and server resource utilisation.

Related Technical Solution AI Crawling and Large WooCommerce Catalogues

Engineering investigation into the infrastructure challenges associated with automated retrieval of large product catalogues.

Official Documentation Apache HTTP Server — mod_rewrite

Authoritative documentation covering server-level URL rewriting and redirect configuration.

Official Documentation Apache RewriteRule Flags

Technical reference for redirect status codes, rewrite processing and query string preservation.