Background:
Redirect example.com
to www.example.com
(root/apex to www subdomain) using Single Redirects (also called Dynamic Redirects).
Prerequisites
Guide:
-
Navigate to your website in Cloudflare, and then to DNS → Records. Magic link .
-
Add a new record. The type should be
AAAA
(IPv6 type), the name should be@
(shorthand for your domain name), the IPv6 Address/value should be100::
(IPv6 Discard, if nothing handles the traffic in Cloudflare, it won’t go anywhere), and Proxy Status should be on :orange:.
Make sure to click Save
.
This will allow traffic to flow into Cloudflare and hit your Redirect. Cloudflare will serve its own Proxy IPs at edge, so both IPv4 and IPv6 Clients (everyone) will be able to connect.
3. Navigate to Rules → Redirects → Create Rule. Magic link
- Create your Redirect Rule. Give it a name, like
Redirect root to www subdomain
, and select Field:Hostname
Operator:equals
, Value:example.com
.
Under “Then… URL Redirect”, change Type toDynamic
and add the following expressionconcat("https://www.example.com", http.request.uri.path)
, checkPreserve Query String
. Replace any mention ofexample.com
with your own domain.
Then click Deploy
.
5. Wait a few minutes and test the redirect.
All steps and diagrams of zone records via the link below
Find and Post your Fav Software https://www.SoftwareHunt.io