Currently, I have two sets of DNS rules set up, one for www.example.com
, and one for example.com
. So far I have a Page Rule that just redirects www.example.com/*
to example.com/$1
. If I didn’t have that page rule set up, my website would be accessible at both URLs, which from my research is bad. From my limited knowledge, it seems that most sites only have one set of DNS rules, then somehow redirect to their canonical site. However, when I disable my www.example.com
rules, I can no longer access the site, and am forced to renter the URL so it reads example.com
.
My questions:
Is having two sets of rules bad? (one for example.com
and another for www.example.com
)
What is the proper way to redirect traffic, and set up DNS so that www.example.com
ends up at example.com
?
Sorry if this is messy, this is my first time messing around with stuff like this.