Adding wildcard redirects
Wildcard redirects are useful when paths within your site change. Because Brightspot constructs paths from sections, paths change most often when a section name or a section hierarchy changes. In such cases, the redirect replaces an old path with a new one. For example, visitors who bookmarked the asset at http://brightspot.com/athletics/latest-scores
are redirected to http://brightspot.com/sports/latest-scores
.
To add wildcard redirects:
- Click > Redirects > Wildcard Redirects.
- Click New Wildcard Redirect on the bottom left.
- In the Name field, enter a description of this redirect. If no name is entered, this field defaults to the local URL and the destination URL, separated by a
->
. - In the Local Urls field, enter the path after the domain name in the URL from which you are redirecting. Add
/*
wildcards to represent an arbitrary path match. For example, if the source URL ishttp://brightspot.com/solutions/*
, enter/solutions/*
. Click to add multiple paths. - In the Destination field, enter the redirect's target URL.
- Toggle on Temporary if you want the browser or search engine to treat the redirect as temporary. If set, the server returns an HTTP 302 temporary redirect; otherwise, it sends a 301 permanent redirect. (For an explanation of the difference between permanent and temporary redirects, see Asset URLs.)
- In the Query String field, select one of the following:
preserve
—When redirecting, append an incoming query string to the URL in the Destination field.ignore
—When redirecting, do not append an incoming query string to the URL in the Destination field.modify
—Modify the incoming query string.
- Toggle on Transfer Matched Segments to have any path and query string after the incoming URL to appear after the destination URL.
- In the Sites widget, from the Owner list, select the site to which this wildcard redirect applies.
- Complete your site's workflow and publish the asset.
Example
A publisher decided to remove the path /solutions
from all its URLs, and all assets under /solutions
are now available directly under the domain name itself. Visitors may have bookmarked assets at the old path, and search engines may continue to return results from the old path as well. When clicking those bookmarks or search results, visitors receive Error 404. As a result, the publisher introduces a wildcard redirect from the old path to the new one. The following examples illustrate this wildcard redirect.
Referring to the previous images—
- The owner of this wildcard redirect is the
Brightspot
site (associated with domain namebrightspot.com
). - Visitors attempting to view an asset matching the pattern
http://brightspot.com/solutions/*
(any asset under the path/solutions
) are redirected tohttps://brightspot.com
. - Because the toggle Transfer Matched Segments is on, the slug after
/solutions
in the local URL is appended tohttp://brightspot.com
. For example, visitors attempting to viewhttp://brightspot.com/solutions/media-desk
are redirected tohttp://brightspot.com/media-desk
. - Visitors attempting to view the asset at
http://brightspot.com/solutions/media-pricing?product-id=25
are sending a query string with the request. Because this wildcard redirect modifies query strings, those visitors are redirected tohttps://brightspot.com/media-pricing?new-product-id=125
.