Rule-based redirects let one short or branded URL route visitors by location, device, campaign parameter, or other conditions. This guide provides a practical redirect-rule matrix, a pre-launch testing checklist, and a recurring audit process for managing these rules across campaigns, QR codes, product launches, and site changes without losing attribution or creating avoidable SEO problems.
Overview
A rule-based redirect evaluates an incoming request and sends it to the most appropriate destination. A geo redirect may route visitors to a regional page, a device-based rule may distinguish mobile from desktop, and a campaign rule may send traffic with a particular UTM value to a launch page or offer.
The useful part is not simply having many rules. It is making their priority, fallback behavior, ownership, and measurement clear. A redirect that works for one browser or country but fails for an untested audience is not a complete routing system.
Before creating rules, decide whether the destination should be permanent or temporary. A 301 redirect is generally appropriate when a URL has been permanently replaced. A 302 redirect or another temporary redirect may be more suitable for a time-limited campaign or an experiment. The status code should reflect the intended duration and SEO behavior of the route, not merely the convenience of the redirect tool.
Keep the original URL stable whenever possible, particularly for printed QR codes, affiliate links, and published campaign links. A dynamic QR code redirect or branded short link can then point to a destination that changes without requiring the code or link to be reissued. For background on QR routing, see Dynamic QR Code Redirects.
What to track
Use a redirect-rule matrix as the source of truth. Store it in a shared document or in the redirect management platform, and give every rule an owner and review date. A practical matrix can use these columns:
- Rule ID: A stable identifier such as QR-SUMMER-01 or GEO-EU-02.
- Source URL: The public path, branded short link, QR destination, or old URL being evaluated.
- Condition: Country, region, device category, query parameter, referrer, date range, or a combination.
- Priority: The order in which the platform evaluates this rule.
- Destination: The final URL, including any required query parameters.
- Status code: The chosen permanent or temporary response.
- Fallback: The destination used when no condition matches or a target is unavailable.
- Campaign fields: Standardized UTM source, medium, campaign, term, and content values where applicable.
- Owner and expiry: The person responsible for the rule and the date it should be reviewed or removed.
- Last test: The date, test location, device, browser, and result.
Track more than click volume. Redirect analytics should also reveal successful responses, errors, destination response codes, unexpected countries or devices, missing UTM parameters, and traffic reaching the fallback. A sudden increase in fallback traffic can indicate a malformed campaign URL, a rule-order change, an expired destination, or a condition that is broader or narrower than intended.
For campaign links, define a naming convention before publishing. For example, use lowercase values and a consistent structure such as utm_source=newsletter, utm_medium=email, and utm_campaign=product_launch. Preserve parameters deliberately: confirm whether the redirect platform passes the original query string, appends campaign values, or replaces conflicting values. The guide to preserving URL parameters through redirects can support this review.
Do not treat location or device detection as infallible. Visitors may use VPNs, privacy tools, shared devices, unusual browsers, or accessibility technology. Always provide a sensible fallback and, where appropriate, a visible way to switch region or view the standard site.
Cadence and checkpoints
Before every launch
- Confirm every source and destination uses HTTPS and resolves correctly.
- Check that the rule conditions are precise and that the priority order is documented.
- Test a matching request, a non-matching request, and a request with missing or unexpected parameters.
- Verify the final destination, status code, query-string behavior, page title, canonical setup, and analytics attribution.
- Test the fallback independently. It should be useful rather than an error page.
- Check for redirect chains and loops. A source should reach the intended final page with as few intermediary hops as practical.
- Record the test results, launch owner, expiry date, and rollback destination.
For a QR campaign, scan from multiple phones and from both a familiar and unfamiliar network. For a device rule, test at least one mobile and one desktop context, then test a tablet or an unrecognized user agent if the platform supports those conditions. For geo rules, use the platform's test tools or controlled regional requests rather than assuming that a local test represents every location.
Monthly monitoring
Review high-volume and high-value rules monthly. Look for error responses, destination changes, unusual traffic by country or device, and campaign links receiving clicks after their intended end date. Check that temporary destinations still exist and that no short links or QR codes point to an obsolete promotion.
Quarterly audit
At least quarterly, compare the rule matrix with the live configuration. Remove abandoned rules, confirm owners, update destination URLs, and retest representative rules from each condition type. Review whether the fallback is still appropriate and whether the rule order makes the documented behavior possible. A recurring redirect monitoring and uptime audit helps turn this work into an operating routine.
How to interpret changes
When performance changes, begin with routing evidence rather than immediately changing the campaign. A drop in clicks may come from reduced promotion, while a drop in completed visits may indicate a broken destination, lost UTM values, a consent or analytics configuration change, or an unexpected redirect chain.
Use a simple diagnosis sequence:
- Reproduce the request: Use the exact source URL, including its query string, and test the relevant device or location.
- Inspect each response: Record status codes, Location headers, and the final URL. A redirect checker or command-line request can expose extra hops and loops.
- Compare with the matrix: Confirm that the live rule, priority, condition, and fallback match the documented version.
- Check attribution: Compare the source, medium, campaign, and content values before and after the redirect. Look for duplicated, stripped, or overwritten parameters.
- Check the destination: Confirm that the page is available, relevant to the audience, and not redirecting again to an unintended location.
Be cautious with apparent geographic or device anomalies. A change in traffic mix may reflect audience behavior rather than a routing failure. Treat a pattern as a troubleshooting signal, then validate it with controlled tests. If a rule causes a serious problem, route it temporarily to a known-good fallback, document the change, and investigate before restoring the original logic.
During site migrations, map old URLs directly to their closest final destinations where possible. Avoid using a broad geo or device rule to conceal missing migration mappings. The bulk URL redirects migration checklist is useful when a large set of permanent redirects must be reviewed together.
When to revisit
Use the checklist before every campaign, QR rollout, product launch, or DNS, SSL, hosting, or redirect-platform change. Run a focused review monthly for active links and a full audit quarterly. Revisit the rule design immediately when analytics attribution changes, a destination is retired, a campaign is extended, or reports show unexpected fallback or error traffic.
Once or twice a year, review the assumptions behind geo-IP data, device classification, privacy controls, and consent-aware measurement. The correct implementation depends on your audience, jurisdiction, analytics setup, and platform capabilities, so document the assumptions rather than treating them as permanent facts.
For the next audit, copy this compact template:
- Rule or link reviewed:
- Owner:
- Source and conditions:
- Expected destination and status code:
- Fallback destination:
- Test locations and devices:
- UTM and query-string result:
- Errors, chains, or loops found:
- Action taken:
- Next review date:
A rule-based redirect system stays dependable when every route has an explicit purpose, a tested fallback, measurable attribution, and a scheduled owner review. Keep the matrix current, test changes before publishing, and use recurring audits to catch problems while they are still routing issues rather than broken campaigns.