Adding a site redirect
Site redirects are valuable in the following situations:
- Adding a vanity site name that points to your site's official name.
- Changing a domain name.
- Retiring a site in favor of a different one.
- Changing a protocol, typically from
http
tohttps
.
In all these cases, a visitor attempting to retrieve an asset from one domain-path combination is redirected to a different domain-path combination.
To add site redirect URLs:
- Ensure the URLs from which you are redirecting are not associated with a live site. Archive those sites, or remove the URL from them.
- Click > Redirects > Site Redirects.
- Click New Site Redirect at the bottom left of the screen.
- In the Name field, enter a description of this redirect. If no name is entered, this field defaults to the site URL and the destination URL, separated by a
->
. - In the Site URLs field, enter the domain name and path from which you are redirecting, such as
http://perfectsensedigital.com/video-integrations
. Click to add multiple URLs. - In the Destination field, enter the target domain name and path.
- Toggle on Transfer Matched Segments to have any path and query string after the incoming URL appear after the destination URL. For more information about this toggle, see "Transferring matched segments," below.
- 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.
- Click Save.
Example
A publisher changed its domain name from www.perfectsensedigital.com
to www.brightspot.com
. Visitors may have bookmarked assets at the old domain name, and search engines may continue to return results from the old domain name as well. When clicking those bookmarks or search results, visitors receive Error 404. As a result, the publisher introduces a site redirect from the old domain to the new one. The following examples illustrate this site redirect.
Referring to the previous images—
- Visitors attempting to view the asset at
http://www.perfectsensedigital.com
are redirected tohttps://www.brightspot.com
. - Similarly, visitors attempting to view the asset at
https://www.perfectsensedigital.com
are redirected tohttps://www.brightspot.com
. - Visitors attempting to view the asset at
http://www.perfectsensedigital/product-pricing?product-id=25
are sending a query string with the request. Because this vanity redirect modifies query strings, those visitors are redirected tohttps://www.brightspot.com/product-pricing?new-product-id=125
.
Transferring matched segments
Toggling on Transferring Matched Segments ensures that the incoming path and the query string after the source URL are appended to the destination URL. For example, you have an existing subdomain for a sports section with the URL https://sports.brightspot.com
, and you want to bring that subdomain as a path under the main company domain as https://brightspot.com/sports
. In this case, any path or query string that appeared after https://sports.brightspot.com
must now appear after https://brightspot.com/sports
.
Incoming requests such as https://sports.brightspot.com/baseball
are now redirected to https://brightspot.com/sports/baseball
.
If Transferring Matched Segments is toggled off, the URL https://brightspot.com/sports/baseball
redirects to the destination URL https://brightspot.com/sports
(the path /baseball
is dropped). Generally, the only reason to toggle off this switch is when you are restructuring a site, and the paths on the old domain do not match the paths on the new domain.