diff --git a/readthedocs/proxito/views/serve.py b/readthedocs/proxito/views/serve.py index 2ea3f53c12f..c35b851153e 100644 --- a/readthedocs/proxito/views/serve.py +++ b/readthedocs/proxito/views/serve.py @@ -14,7 +14,7 @@ from readthedocs.builds.constants import EXTERNAL, INTERNAL, LATEST, STABLE from readthedocs.builds.models import Version from readthedocs.core.mixins import CDNCacheControlMixin -from readthedocs.core.resolver import resolve_path +from readthedocs.core.resolver import resolve_path, resolver from readthedocs.core.unresolver import ( InvalidExternalVersionError, InvalidPathForVersionedProjectError, @@ -281,7 +281,8 @@ def _get_canonical_redirect_type(self, request): .filter(canonical=True, https=True) .exists() ) - if canonical_domain: + # For .com we need to check if the project supports custom domains. + if canonical_domain and resolver._use_cname(project): log.debug( "Proxito Public Domain -> Canonical Domain Redirect.", project_slug=project.slug,