I have a website where any request to the non-www domain i.e. http://example.com
is redirected (with status 301) to http://www.example.com
by the server.
If I'm using Django's sites
framework, should I set the domain as example.com
or www.example.com
? All the documents that I've seen always refer to domain as example.com
. I'm confused if the sites framework refers to domain as the full qualified domain name
or just the domain name
. Django docs define domain as "The domain name associated with the Web site". This makes me think it should be without the www part. But this breaks the sitemap (Django generates all URLs without www).
The PREPEND_WWW
settings is another reason for the confusion. It appears as if Django wants you to just define the domain as example.com
and then use this setting to prepend www
.