Redirect Rules Setup - LawtonChilesRedCrossClub/website GitHub Wiki

LCHS Red Cross Club — Redirect Rules Setup (Cloudflare)

Purpose

Redirect Rules ensure that visitors always land on the secure www version of the site. This prevents confusion and enforces best practices for security and consistency.

Domain: lchsredcross.org Custom Domain: www.lchsredcross.org


Step 1 — Log Into Cloudflare

  1. Go to https://dash.cloudflare.com
  2. Select the domain lchsredcross.org.
  3. In the left sidebar, click Rules → Redirect Rules.

Step 2 — Rule #1: Redirect HTTP → HTTPS

  1. Click Create Rule.
  2. Configure the rule as follows:
    • Rule Name: Redirect HTTP to HTTPS
    • If incoming requests match: Wildcard pattern
    • Request URL: http://*
    • Then: Redirect to target URL: https://{hostname}{uri}
    • Status Code: 301 (Permanent Redirect)
    • Preserve query string: ON
  3. Place at: First / Top in rule order.
  4. Save and Deploy.

Purpose: Ensures all traffic always uses HTTPS (secure lock 🔒).


Step 3 — Rule #2: Redirect Root → WWW

  1. Click Create Rule (or use the "Redirect from root to WWW" template).
  2. Configure the rule as follows:
    • Rule Name: Redirect root to WWW
    • If incoming requests match: Hostname equals lchsredcross.org
    • Then: Redirect to target URL: https://www.lchsredcross.org/$1
    • Status Code: 301 (Permanent Redirect)
    • Preserve query string: ON
  3. Place this rule after the HTTP → HTTPS rule.
  4. Save and Deploy.

Purpose: Ensures that visitors typing lchsredcross.org are always sent to www.lchsredcross.org.


Step 4 — Test Redirects

After rules are active, test in a browser:


Notes

• Always use 301 Permanent Redirect so browsers remember the redirect. • Rule Order is critical:

  1. HTTP → HTTPS
  2. Root → WWW • Redirect rules are processed in order from top to bottom. If rules are out of order, visitors may see the wrong redirect.