Skip to main content
The Set status code option defines a custom HTTP status code for content hosted on a CDN resource. The code can be applied globally to all resource content or selectively to specific files via Rules. A schedule with an Apply from and Until time range lets the code activate only during certain hours. A common use case is age-restricted content compliance — return a 403 error code or redirect users to a different page after 22:00, and configure the schedule to activate the code only during the restricted hours. The option is available in two places:
  • Via Resource settings — applies the custom code to all content on the CDN resource.
  • Via Rules — applies the custom code only to files matching the rule pattern.
Select the appropriate tab below.
  1. In the Gcore Customer Portal, navigate to CDN > CDN resources.
  2. Click the CNAME of the required CDN resource to open Resource settings.
CDN resources list
  1. Navigate to the OPTIONS tab.
  2. In the left menu, click Content to scroll to the Content section.
  3. Enable the Set status code toggle.
Enable the Set status code option
  1. In the Status code field, enter the desired HTTP status code. The field defaults to 200.
  1. (Optional) In the URL or code text field, enter a redirect URL or an HTTP status code text.
  2. (Optional) Select Apply on schedule. In the expanded block, set Apply from, Until, and Timezone to define the time range when the custom status code is active.
  3. Click Save changes.
Configure the Set status code option
The custom code is now applied to all files delivered via the CDN resource.