Difference Between Rules - When To Use What for Redirect?

Hi,

That would result in 2 redirects for requests that need both (http://www.example.com). You can do with one redirect by crafting a Redirect Rule and turning off AUH.

When incoming requests match:
Hostname eq "www.example.com"
or
SSL Off
Then
Redirect Type: Dynamic
Expression: concat("https://example.com", http.request.uri.path)
Preserve query string: Yes

You need to setup rules for each zone.

I’d refer you to the documentation, as they are clearly explained. In case you try something that doesn’t work, then open a topic here for a specific question detailing what you have tried and what were the expected and actual results (error messages, redirect loop etc.)

I’ll only point out that Page Rules will at one point become obsolete, as other Rules were created to replace their functionality; please read The future of Page Rules.

Hi, @muresanmihaicristian, I’d suggest you refrain from posting ChatGPT or other AI-generated responses without first thoroughly reviewing them, as, despite your best intentions, they tend to be based in old documentation and are often incorrect, too verbose and repetitive.

If your reply was, as I suspect, AI-generated, please remove it as it contains several incorrections:

  1. The suggested Page Rule pattern would create a redirect loop, as it also includes the target URL.
  2. The answer to the question about redirecting several domains within an account solves a different problem, that of redirecting several hostnames within the same zone.
  3. The description of Origin Rules is completely wrong.
  4. The Redirect Rules description is overly and unnecessarily repetitive.

But if instead you wrote the reply yourself, I suggest you spend some time reviewing it, as well as reading the relevant documentation.

6 Likes