Using EdgeRules, it is possible to dictate how status code 404 "Not Found" pages will look and interact with clients ending up on nonexistent locations. This article will assist in the creation of such a rule.
The EdgeRules feature is available only on Enterprise plans.
Creating the Rule
There is a directive within the EdgeRules which can be used to redirect error responses from the CDN to a custom error page location. This directive is called ERROR PAGE
and below is an example use-case:
Note that in order to catch and forward the appropriate error, two arguments must be defined:
- Error code
- Error page destination
Verifying the Rule
CURL Example
curl -I http://foo.bar.netdna-cdn.com/fake-page/
HTTP/1.1 302 Moved Temporarily
Date: Fri, 07 Mar 2014 14:35:28 GMT
Content-Type: text/html
Content-Length: 161
Connection: keep-alive
Location: http://domain.com/404.html
Server: NetDNA-cache/2.2
X-Cache: MISS
Resulting nginx configuration block
location / {
error_page 404 http://domain.com/404.html;
proxy_intercept_errors on;
...
}
We hope this article was helpful and as always, If there are any questions or concerns about any of the topics mentioned in this article, please feel free to reach out to support - we are available 24/7 by chat or email!