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
- Go to https://dash.cloudflare.com
- Select the domain
lchsredcross.org
. - In the left sidebar, click Rules → Redirect Rules.
Step 2 — Rule #1: Redirect HTTP → HTTPS
- Click Create Rule.
- 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
- Place at: First / Top in rule order.
- Save and Deploy.
Purpose: Ensures all traffic always uses HTTPS (secure lock 🔒).
Step 3 — Rule #2: Redirect Root → WWW
- Click Create Rule (or use the "Redirect from root to WWW" template).
- 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
- Place this rule after the HTTP → HTTPS rule.
- 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:
- http://lchsredcross.org → https://www.lchsredcross.org
- http://www.lchsredcross.org/gallery → https://www.lchsredcross.org/gallery
- https://lchsredcross.org/events → https://www.lchsredcross.org/events
Notes
• Always use 301 Permanent Redirect so browsers remember the redirect. • Rule Order is critical:
- HTTP → HTTPS
- Root → WWW • Redirect rules are processed in order from top to bottom. If rules are out of order, visitors may see the wrong redirect.