Skip to content

CF Transform Rules

Amogh S edited this page Jul 20, 2021 · 1 revision

Transform rules are currently not supported by cloudflare terraform provider. Therefore documenting them here

URL rewrite rules

For appending prerender=true query parameter on bot requests

  1. Rule Name: prerender-with-qs

    • expression:
        (http.user_agent matches "(?i)(googlebot|bingbot|yandex|WhatsApp|baiduspider|facebookexternalhit|twitterbot|linkedinbot|quora link preview|redditbot)" and len(http.request.uri.query) ne 0 and not http.request.uri.query contains "prerender" and http.host in {"malibu-advanced-web.quintype.io" "malibu-web.quintype.io" "hindi.thequint.com" "thequint-beta.quintype.io" "thequint-fit-malibu-beta.quintype.io" "thequint-hindi-malibu-beta.quintype.io" "thequint-malibu-beta.quintype.io" "prabhatkhabar-beta.quintype.io" "www.prabhatkhabar.com"})
      
    • Path: preserve
    • Query: Dynamic concat(http.request.uri.query, "&prerender=true")
  2. Rule Name: prerender-without-qs

    • expression:
      (http.user_agent matches "(?i)(googlebot|bingbot|yandex|WhatsApp|baiduspider|facebookexternalhit|twitterbot|linkedinbot|quora link preview|redditbot)" and len(http.request.uri.query) eq 0 and http.host in {"malibu-advanced-web.quintype.io" "malibu-web.quintype.io" "hindi.thequint.com" "thequint-beta.quintype.io" "thequint-fit-malibu-beta.quintype.io" "thequint-hindi-malibu-beta.quintype.io" "thequint-malibu-beta.quintype.io" "prabhatkhabar-beta.quintype.io" "www.prabhatkhabar.com"})
      
    • Path: Preserve
    • Query: Dynamic concat(http.request.uri.query, "prerender=true")