Category: URL
Purpose: Redirects requests via the Location header.
This capability requires Rules Engine - Advanced Rules which must be purchased separately. Contact your CDN account manager to activate it.
The configuration of this feature requires setting the following options:
Option | Description |
---|---|
Source |
Identify requests that will be redirected via a relative path. This relative path, which starts directly after the hostname in the CDN URL, is shown in blue font below. http://wpc.0001.omegacdn.net/800001/myorigin/path/file.ext
Verify that the specified pattern doesn't conflict with the parent match conditions defined for this feature. Valid syntax varies according to the number of customer origins that you would like to match.
You may only define a customer origin using a literal value (e.g., marketing) or one of the regular expressions patterns defined above. All other regular expression syntax is disallowed when defining a customer origin. This limitation does not apply to the relative path defined after the content access point. |
Destination |
Define the URL path to which the above requests will be redirected. Dynamically construct this URL path using:
It is highly recommended to use an absolute URLThis type of URL identifies a resource (e.g., asset or file) using the following format: scheme://server/path/resource (e.g., http://cdn.mydomain.com/sales/presentation.pdf).. The use of a relative URL may redirect CDN URLs to an invalid path. URL encoding should not be applied to the specified URL. |
Code |
Select the response code that will be returned to the requester. |
In this example, we will demonstrate how to redirect an edge CNAME URL that resolves to this base CDN URL:
Qualifying requests will be redirected to this base edge CNAME URL:
This URL redirection may be achieved through the following configuration:
Key points:
The URL Redirect feature defines the request URLs that will be redirected. As a result, additional match conditions are not required. Although the match condition was defined as "Always," only requests that point to the "brochures" folder on the "marketing" customer origin will be redirected.
Sample requests:
http://wpc.0001.omegacdn.net/800001/marketing/brochures/widgets.pdf
http://wpc.0001.omegacdn.net/800001/marketing/brochures/campaignA/final/productC.ppt
http://marketing.mydomain.comThis request will satisfy the URL Redirect's match condition if this hostname points to "/800001/marketing."/brochures/widgets.pdf
http://brochures.mydomain.comThis request will satisfy the URL Redirect's match condition if this hostname points to "/800001/marketing/brochures."/campaignA/final/productC.ppt
All matching requests will be redirected to the edge CNAME URL defined in the Destination option.
Sample scenario #1:
Sample request (CDN URL):
http://wpc.0001.omegacdn.net/800001/marketing/brochures/widgets.pdf
Request URL (after redirect):
http://cdn.mydomain.com/resources/widgets.pdf
Sample scenario #2:
Sample request (Edge CNAME URL):
http://marketing.mydomain.comThis hostname points to "/800001/marketing."/brochures/widgets.pdf
Request URL (after redirect):
http://cdn.mydomain.com/resources/widgets.pdf
Sample scenario #3:
Sample request (Edge CNAME URL):
http://brochures.mydomain.comThis hostname points to "/800001/marketing/brochures."/campaignA/final/productC.ppt
Request URL (after redirect):
http://cdn.mydomain.com/resources/campaignA/final/productC.ppt