imbahub
Menu +
US
Talk to us
IMBAHUB / Knowledge & guides

Test which redirect rule wins when several can match.

A migration map can name the right destination while your configuration selects a different rule. This guide tests precedence and matching boundaries. Use an isolated environment with the relevant execution layers and a recorded configuration version; decide replacement content through the URL mapping process.

Which match should win?
  1. Exact exception

    A specific decision needs effective precedence.

  2. Broad pattern

    The intended group moves without capturing other paths.

  3. No match

    An unaffected address follows its usual route.

A correct positive match needs tests of the exceptions too.

An exact rule sits below a broad pattern that terminates first. Does specificity save it?

Not under a first-match model. Correct the order or boundary for the actual platform and rerun the complete selection.

Draw the execution chain before testing collisions

List every layer that can issue a redirect, such as CDN, hosting and application. Read the platform's execution model and identify where a matching action ends processing. Do not assume all layers share first-match or last-match behavior.

In a fictional example, a specific archive address stays while a broader article tree moves. Write the intended winner for that collision before running the request. Include an ordinary path that should match only the broad pattern.

Choose positive and negative matching cases

Include an exact source address, a valid pattern member and a similar address outside the intended scope. Add the protected exception, a relevant language path and an asset or API route that must remain untouched.

Try slashes, encoded characters and query values where these affect the rule. Change one dimension at a time so a failure has an explainable cause. Use prepared test addresses within the agreed scope.

CaseWhat it isolatesExpected decision
Exact special casePrecedence over broad patternApproved exact action wins
Ordinary pattern memberIntended coverageBroad rule selects the right target
Similar unaffected addressOvermatchingNo unintended move
Protected resource pathPages versus APIs or filesAgreed delivery stays intact
Address in two layersCDN versus hosting or appIdentified layer returns the intended response

Observe the active rule and first response

Request without automatically following redirects and record status and destination. Use platform tracing where available to identify the active rule. A final destination alone can hide an earlier layer's incorrect choice.

Reorder or narrow a rule only against a documented decision, then rerun the affected collision cases. Do not revise an expected target just to fit the current error. Also check whether the target can match again and create a loop.

Keep precedence as a maintenance requirement

When a new general rule arrives, retest its intended members and existing exceptions. Record why each exception exists and where it belongs. A future maintainer should be able to understand the order without guessing.

Record configuration version, layer, test address, possible matches, actual winner and retest. Continue with the migration protocol for complete status chains and destination content. An isolated precedence test neither authorises production deployment nor proves how search engines will treat the move.

Sources and further reading

Questions, answered

Does the most specific rule always win?

Only if the platform's model establishes that result. An exact rule can lose when an earlier match already terminates the request.

Why test addresses that should not move?

They expose patterns that match too broadly. Positive matches alone do not prove the boundary.

IMBAHUB

Let’s plan your website

Choose a collision address and three negative cases before adding a general rule.

Talk to us
Existing English product interface with fictional demonstration content; reused for the US website.

Existing English product interface with fictional demonstration content; reused for the US website.