While poring over my Google Analytics data I noticed the notification below.
Obviously this is not a train smash, but it is compromising the quality of my data. And it also offends my OCD. This is what I did to fix the problem.
The web site in question is built with Django and lives behind NGINX. What I needed to do was either map racently.com to www.racently.com or the reverse. There are a number of really informative threads on StackOverflow and elsewhere addressing this issue. I found this one particularly enlightening.
I edited my NGINX configuration as follows:
This maps http://racently.com and http://www.racently.com (first server block) as well as https://racently.com (second server block) onto https://www.racently.com.
Let’s do a quick test to check that it works as planned.
In each case we’re looking at the Location entry, which should be https://www.racently.com/. The 301 redirects all work fine. Finally check that https://www.racently.com still works.