Using Page Rules to Re-Write Host Headers

The ability to rewrite Host Headers is now available in Page Rules. This feature is currently available for domains on the Enterprise plan.

A common use case for this functionality is when your content is hosted on an Amazon S3 bucket. Amazon has designed their system to only accept host headers that have the same name as the bucket hosting your content. In this way, a request to "Host:" must be re-written to “Host:", or else the request will be denied.

*Note: In some cases you can adjust your Amazon S3 Bucket to accept Host Headers that are not the bucket name.

To ensure the header is rewritten, simply go to Page Rules, specify the URI this rewrite will apply to, and write in the Host Header you want to change to. Do this in the "Host Header Override" text box. Any request matching the URI you have specified, will have the Host Header overridden to the one you have put in the "Host Header Override" box." Please see the example below:

Not finding what you need?

95% of questions can be answered using the search tool. This is the quickest way to get a response.

Powered by Zendesk