Adding a redirect for Rate Limit

I am attempting to add a redirect for a Rate Limit rule but the PUT request to update the rate limit is returning an error: ``text/html is not valid content type despite the documentation (screenshot of documentation attached, as well as the error returned from API). Documentation for custom html/redirect: https://support.cloudflare.com/hc/en-us/articles/115001635128-Configuring-Cloudflare-Rate-Limiting#7uCtK6GPAfWDNlSHch7KBs


It looks like that’s not allowed:

The looks like the HTML response would be through the Custom Pages feature:

Thanks for the custom pages information. I’m confused on the documentation for the Rate Limiting response, which appears to offer exactly what I need but conflicts with the allowable response types. Here’s what I see in the Help Center, note the instructions highlighted for adding a meta refresh to the response.

What I’m trying to accomplish:
If a user of my web application triggers the rate limit rule, I want to redirect them to a specific page on my site where I log additional details about the user and ban their account in my application. It’s unclear if a Custom Page that is hosted outside of my application by Cloudflare will provide access to the user’s information.

Ohhh…I totally missed that API feature. Judging by the documentation, it’s in the Business/Enterprise section for Advanced Response. Are you on a Business or Enterprise plan?

Yes - upgraded to Business specifically to take advantage of this feature.

D’oh! I just noticed the actual error. You used text/html (like the support document said), but the API example is text/xml, as the error indicates.

I’m not familiar enough with XML to know if you can do a refresh.

Thanks so much @sdayman - I really appreciate your help!

I tested it out with text/xml and the API update went through successfully, however the refresh doesn’t actually happen (the <meta http-equiv="refresh" content="0; url=https://my-url-here" /> gets displayed in the browser as text). :confused: I have an open support ticket (2273160) regarding this but have yet to receive a response there.

1 Like

I don’t expect Support will debug your XML for you. Have you Googled around on how to do a redirect with XML?