To WWW or not to WWW
The great debate
In this module, we chose to have the bare or apex domain
zappaguide.com as our primary site. Many folks prefer to have
www.zappaguide.com as the primary site.
Of course, there is no right or wrong answer. It's easy to have the
www version of the domain by inserting it in the appropriate locations.
What about both?#
Another common desire is to have both the bare domain work as well as the
www version. You can take two approaches:
redirect one to the other
alias one to the other
For this course, I'm assuming that the bare domain is the primary and the
www is the secondary. If you choose the opposite, reverse the terms while reading.
Redirect one site to the other#
Redirection means that the browser can load
www.zappaguide.com but receives the HTTP response of 301 moved permanently. This means that the browser is redirected to
zappaguide.com and navigates to that site.
The user sees the address bar changed to be
zappaguide.com (although many browsers now hide the
www part of the address anyway), and the new page loads.
Redirection requires an HTTP server running at
www.zappaguide.com. If you already have an HTTP server running, then it will be straightforward to configure the web server to send the redirect.
If you don't have a server, then you can use a static web site service like S3, Github, or Netlify to provide the redirect.
It is a little bit inconvenient to set up an entire web server to just send a 301 code. However, this method is well understood and supported.