Remove other changed logic
@@ -113,7 +113,7 @@ def server_error_404(request, exception=None, template_name='404.html'): # pyli
return response
# Try to serve custom 404 pages if it's a subdomain/cname
- if getattr(request, 'host_project_slug', False):
+ if getattr(request, 'subdomain', False) or getattr(request, 'cname', False):
return server_error_404_subdomain(request, template_name)
# Return the default 404 page generated by Read the Docs
