Path and query forwarding

In the context of URL redirects, the path forwarding mode determines which, if any, segments of the requested URL path to retain and append to the target URL. You can also enable query forwarding to append the query string from an incoming request to the target URL.

Path forwarding modes

There are three path forwarding modes (all, capture, or none) when configuring a redirect configuration.
Note: The structure of the requested URL must match the source URL exactly in order for it to be redirected. You must specify each anticipated URL path segment in a separate source URL entry or use a wildcard in the first and/or last segment of the URL path.

All

The all path forwarding mode indicates that the entire URL path included in incoming requests to the source URL is appended to the target URL. For example, suppose you specify a source URL, www.old.com/*, and a target URL, www.new.com. In this case, incoming requests for www.old.com/about are redirected to www.new.com/about.

Capture

The capture path forwarding mode indicates that only the segment of the requested URL path matching the wildcard segment defined in the source URL should be appended to the target URL. For example, suppose you specify a source URL, www.old.com/products/*, and a target URL, www.new.com, then incoming requests for www.old.com/products/software are redirected to www.newexample.com/software.

Important notes:

  • You can only use a wildcard within the first and/or last segment within a URL path, such as example.com/*/abc/*. You cannot put a wildcard segment in a segment in the middle of the path.
  • You can use a wildcard to cover a portion of a path segment. For example, you can specify example.com/*pdf to match incoming requests for any PDF files that exist at that level of the site structure.

None

The none path forwarding mode indicates that no part of the requested URL path should be appended to the target URL. In this case, all incoming requests whose structure matches the source URL are redirected to the target URL as defined.

Note: The structure of the requested URL must match one of the defined source URL path structures, even if you select none as your path forwarding mode. For example, if your only defined source URL is old.com/ and the target URL is new.com, then requests for old.com/about receive a 404 error message. You can avoid this by adding another source URL for old.com/about or old.com/*. Include any other source path structures you anticipate being requested to ensure an exact match when processing incoming requests.

The following table provides some scenarios demonstrating how various incoming requests would be handled and redirected based on the selected path forwarding mode.

Source URL Target URL Requested URL Path fwd mode Outcome
old.com/ new.com old.com/ all new.com
capture new.com
none new.com
old.com/about all 404 ERROR – The structure of the requested URL path does not match the source URL path structure.
capture
none
old.com/* new.com old.com/ all new.com
capture new.com
none new.com
old.com/about all new.com/about
capture
none new.com
old.com/about/us all new.com/about/us
capture
none new.com
old.com/products/* new.com old.com/products/about all new.com/products/about
capture new.com/about
none new.com
old.com/about all 404 ERROR – The structure of the requested URL path does not match the source if URL path structure.
capture
none
old.com/*pdf new.com old.com/installation.pdf all new.com/installation.pdf
capture new.com/installation.pdf
none new.com
old.com/*/contact new.com old.com/installation.pdf all new.com/installation.pdf
capture new.com/installation
none new.com

Query forwarding

Enable query forwarding to apply the incoming query string following the URL path (the segment after the question mark) to the new target URL. For example, looking at the URL http://sourceexample.com/page?val=34, the query string is ?val=34. If query forwarding is enabled, this segment is applied to the end of the target URL. This behavior is recommended if the destination website adheres to the legacy query structure from the original site. If this option is disabled, the incoming query string is ignored.