How to make both www and non-www resolve without redirecting

Part of Cleavr’s logic is to redirect non-www traffic to www or www traffic to non-www depending on how the site is setup.

If was used to create the site, then non-www traffic is configured to redirect to www.

If was used to create the site, then www traffic is configured to redirect to non-www.

This is pretty important for SEO as you’ll want your site to indexed using one or the other. But, if SEO isn’t important in your case, for whatever reason, and you want both www and non-www to resolve without redirecting, then the best way to accomplish this is as follows:

Create the new site with as the domain.

Then, after the site is created, in the Settings section, add as an alias.

Next, you’ll need to SSH into your server and update the redirect.conf file which is located in etc/nginx/cleavr-conf/

Essentially, just remove the redirect logic

server {
  include /etc/nginx/cleavr-conf/;
  return 301 $scheme://$request_uri;

Update to:

server {
  include /etc/nginx/cleavr-conf/;

Your site will now resolve when a user types in or without redirecting.

1 Like