Redirect Types & Concepts
What is an A/B redirect?
An A/B redirect is a redirect rule that splits incoming traffic between two or more versions of a page, sending some visitors to the original version and others to a variation, in order to test which version performs better. Instead of all visitors seeing the same page, a proportion of them are redirected to an alternative URL where a different design, headline, layout, or content is served. The relative performance of the two versions, measured through conversion rates, engagement metrics, or other goals, determines which version wins the test.
The “A/B” in A/B redirect refers to the two versions being tested: version A, the original or control, and version B, the variation or challenger. The redirect mechanism is what routes visitors between the two without requiring them to do anything; they simply arrive at a URL and the testing infrastructure decides, typically based on a random assignment, whether they see version A or version B.
A/B redirects are one of the most direct forms of split testing on the web. They are particularly useful for testing pages where the variation is significant enough to require a different URL: a completely different layout, a different page template, or content that cannot be tested through on-page element swapping alone. Understanding how to implement A/B redirects correctly, particularly with respect to SEO, is important because poorly configured split tests can damage search rankings in ways that are difficult to diagnose and slow to recover from.
How an A/B redirect works
The mechanics of an A/B redirect involve a traffic splitting layer that sits between the incoming request and the page that is ultimately served.
When a visitor requests a URL that is part of an A/B test, the testing infrastructure intercepts the request and makes an assignment decision: which version should this visitor see? The assignment is typically random, with a configured split ratio. A 50/50 split sends half of visitors to version A and half to version B. An 80/20 split sends 80% to the control and 20% to the variation, useful when the variation involves higher risk and limiting exposure is prudent.
Once the assignment is made the visitor is redirected to the appropriate version. If assigned to version A, the original, they either stay on the original URL or are redirected to a canonical version of it. If assigned to version B, the variation, they are redirected to the alternative URL where the variation is served.
The assignment is stored, typically in a cookie, so the same visitor consistently sees the same version throughout the test. A visitor assigned to version B on their first visit sees version B on all subsequent visits during the test period. This consistency is essential for meaningful results; a visitor who sees different versions on different visits produces unreliable data.
A/B redirect vs on-page A/B testing
A/B redirects are one approach to split testing but not the only one. Understanding the difference between A/B redirects and on-page A/B testing helps clarify when each is appropriate.
On-page A/B testing: the most common form of split testing. The visitor arrives at the original URL and the page looks normal. JavaScript testing code then modifies specific elements of the page, changing a headline, swapping an image, reordering sections, to show the variation without changing the URL. The visitor’s URL remains the same regardless of which variation they are in.
On-page testing is simpler from an SEO perspective because both the control and variation are served from the same URL. There is no redirect, no alternative URL, and no duplicate content risk. The limitation is that on-page testing requires JavaScript to execute before changes are visible, sometimes producing a brief flash of the original content before the variation loads, and is limited to changes that can be made through DOM manipulation.
A/B redirect testing: the variation is served at a separate URL. The visitor is redirected to the variation URL rather than seeing a modified version of the original page. This is better suited for testing significant changes that cannot be achieved through DOM manipulation: completely different page templates, different URL structures, entirely different content approaches. The trade-off is the additional SEO complexity introduced by having two URLs serving similar content.
The choice between on-page and redirect-based testing depends on the nature of the test. Minor variations, headline copy, button colour, image selection — are better suited to on-page testing. Major structural variations, different page layouts, different URL patterns, different content architectures, may require A/B redirect testing.
A/B redirects and SEO
A/B redirects introduce specific SEO risks that must be managed carefully. Poorly configured split tests are a well-documented source of SEO damage; Google has written about this explicitly and provided guidance for running tests without harming rankings.
Use 302 not 301: the most important SEO rule for A/B redirects. A 301 permanent redirect from the original URL to the variation URL tells search engines the original URL has permanently moved. The variation URL becomes the canonical destination. SEO equity transfers to the variation URL. When the test ends and the redirect is removed, the equity does not automatically return; the original URL must rebuild its authority. Always use 302 temporary redirects for A/B testing so search engines keep the original URL indexed and no equity is transferred to the variation.
Do not hide tests from Googlebot: cloaking, showing different content to search engine crawlers than to users, is a violation of Google’s guidelines and can result in manual penalties. An A/B test that redirects human visitors to a variation but always shows Googlebot the original is technically cloaking. The correct approach is to allow Googlebot to be assigned to a variation just as human visitors are, with the variation content being a legitimate alternative rather than content designed to manipulate rankings. The key distinction is that the variation must be a genuine test of real user experience improvements, not a hidden SEO manipulation.
Canonical tags: the variation URL, version B, should include a canonical tag pointing back to the original URL, version A. This tells search engines that the variation is a test duplicate of the original and that the original is the canonical version. Without this annotation, search engines may index both the original and variation URLs, creating duplicate content issues that split SEO equity between the two.
Test duration: A/B tests should run for the minimum duration needed to achieve statistical significance and then be concluded. A test running for months with a 302 redirect in place is unlikely to cause immediate SEO damage, Google is generally patient with temporary redirects, but extended tests increase the risk that search engines begin treating the temporary redirect as permanent and updating their index accordingly. Conclude tests promptly and deploy the winning version.
Test scope: A/B redirect testing should be limited to a subset of pages rather than applied site-wide wherever possible. Testing the homepage, a key landing page, or a representative product page provides meaningful data without exposing the entire site to testing-related SEO risk.
Traffic splitting mechanisms
The traffic splitting that makes A/B redirects work can be implemented at several layers of the infrastructure stack, each with different capabilities and trade-offs.
Server-side splitting: redirect logic implemented in the web application or server configuration that assigns visitors and issues redirect responses before the page loads. Server-side splitting is the most reliable approach because it happens before any content is delivered; there is no flash of original content before the variation loads and the redirect is a genuine server-side redirect rather than a client-side navigation.
CDN edge splitting: traffic splitting logic implemented at the CDN edge layer using tools like Cloudflare Workers or similar edge computing platforms. Edge-level splitting is geographically close to visitors, adds minimal latency, and can handle very high traffic volumes without load on the origin server. Cloudflare Workers in particular are well-suited to A/B redirect testing: request interception, cookie-based assignment persistence, and redirect responses can all be implemented in a few lines of JavaScript at the edge.
JavaScript client-side splitting: a JavaScript testing library that runs in the browser, makes the assignment decision, and redirects the visitor using window.location.replace. This approach loads the original page before the redirect fires, producing a flash of the original content, and depends on JavaScript being available and executing before the visitor sees the page. It is the least performant and least reliable splitting approach for redirect-based tests. Most dedicated A/B testing platforms have moved away from pure client-side redirect splitting for this reason.
Dedicated A/B testing platforms: tools like Optimizely, VWO, and Google Optimize (now deprecated) implement their own traffic splitting infrastructure that handles assignment, persistence, and redirect logic. These platforms provide statistical analysis, visual variation editors, and management interfaces alongside the splitting mechanism, abstracting the infrastructure complexity behind a managed service.
Setting up an A/B redirect correctly
A correctly configured A/B redirect test follows a consistent setup process that protects both test validity and SEO.
Define the test hypothesis: before configuring any redirect, define what is being tested, why, and what metric determines a winner. A test without a clear hypothesis produces data that is difficult to interpret and easy to misuse.
Create the variation URL: the variation page needs to exist at a stable URL before the test begins. The URL should be meaningful, /landing-page-v2 rather than /test-12345, and the page should be fully functional and correctly canonicalised back to the original URL.
Configure 302 redirects for the test population: the splitting logic should issue 302 responses for visitors assigned to the variation, redirecting them from the original URL to the variation URL. Visitors assigned to the control stay on or are redirected back to the original URL.
Set the split ratio: choose an appropriate traffic split. 50/50 produces the fastest results but exposes half of traffic to an unproven variation. 80/20 or 90/10 is more conservative; the test takes longer to reach significance but limits the proportion of traffic affected by a potentially underperforming variation.
Implement assignment persistence: store the visitor’s assignment in a cookie so they consistently see the same version. A cookie with a reasonable lifespan, 30 days is common, prevents visitors from being reassigned between visits and contaminating the test data.
Add canonical tag to variation: the variation URL must include <link rel="canonical" href="https://example.com/original-page"> pointing back to the original. This is non-negotiable from an SEO perspective.
Monitor SEO signals during the test: watch Google Search Console for any unexpected changes in coverage, rankings, or crawl behaviour for the test URLs during the test period. Any significant negative signal should prompt an investigation before the test concludes.
Conclude the test and deploy the winner: once statistical significance is reached, end the test. If version B wins, deploy its content as the new version of the original URL, updating the original page’s content rather than making the variation URL permanent. If version A wins, remove the variation URL and all associated redirect rules. Always clean up test infrastructure completely after a test concludes.
A/B redirects vs multivariate testing
A/B redirects test two versions of a page: control and one variation. Multivariate testing extends this to test multiple elements simultaneously across many combinations, three headline options combined with two image options produces six combinations, with traffic split across all of them.
Multivariate testing with redirect-based traffic splitting is significantly more complex because each combination requires a separate URL and separate redirect rules. The traffic required to achieve statistical significance across many combinations is much higher than for a simple A/B test.
For most redirect-based testing scenarios A/B testing, testing one variation at a time, is more practical and produces clearer results. Multivariate testing is better suited to on-page testing approaches where the variations are injected into a single URL rather than split across multiple redirect destinations.
Common A/B redirect mistakes
Using 301 instead of 302: the most damaging A/B redirect mistake. Permanent redirects transfer SEO equity to the variation URL and are cached by browsers, undoing the test and its SEO implications becomes difficult. Always use 302.
No canonical tag on the variation: without a canonical pointing back to the original, both the original and variation URLs may be indexed as separate pages with duplicate content. The canonical tag is mandatory.
Running tests too long: extended tests increase the risk of search engines treating the temporary redirect as permanent. Reach statistical significance and conclude the test promptly.
Not cleaning up after the test: leaving redirect rules and variation URLs in place after a test concludes creates unnecessary redirect chains, duplicate content, and orphaned pages. Always fully remove test infrastructure when a test ends.
Testing too many pages simultaneously: running A/B redirect tests on dozens of pages at the same time creates a complex, difficult-to-manage configuration with many potential interactions. Test a small number of high-impact pages at a time.
Making the variation the permanent URL: when version B wins, the winning content should be deployed at the original URL, not by making the redirect to the variation URL permanent. Making the 302 a 301 and keeping the variation URL as the destination is an inferior outcome that leaves equity split and creates a permanent redirect where none is needed.