Www. subdomain not working using branch deploy - Getting 404

My site name is https://www.altra.space/ or https://altra.space/

When I create a subdomain for my branch consult, the https://consult.altra.space/ works however https://www.consult.altra.space/ returns Not found - Request ID: b71af2e0-12af-42fd-9fe9-ca1bcfcf0d50-33214358

I have tried everything I can think of and looked in the docs and community but no luck!

@jackow98 Welcome to the Netlify community.

The DNS settings for your custom domain seem to be OK, but somehow requests are not getting through to Netlify. When I look at the return, I see that BitDefender is blocking the content. Do you have content on your site that could be causing security issues?

I don’t belive so, what kind of content could cause such issues? I would think that if there was such issues then both https://www.consult.altra.space/ and https://consult.altra.space/ would not work as opposed to just the former not working

www.subdomain.domain.tld is not supposed to work out of the box.

www in itself is a sub-domain of the apex domain. And you’re using a sub-sub domain by doing what you’re trying. Any specific reason to do so?

However if you really want it, I think you can create a DNS record for that domain, but I’m not sure if it would work.

Hello,

When using branching, Netlify appears to have created a NETLIFY DNS record for the www.subdomain, however, the above error still shows. Deleting this NETLIFY record and replacing with a CNAME record still causes the same error

Hi, @jackow98. The branch subdomain feature makes the branch name the subdomain of the primary custom domain domain. If the primary custom domain is altra.space (and it is) and the branch name is staging then the branch subdomain will be only staging.altra.space. There will be no www prefix for the branch subdomain.

This means that if if the primary custom domain was www.altra.space then the branch subdomain would be staging.www.altra.space (not www.staging.altra.space).

It sounds like you want to add a domain alias which points to the branch. At this time, there only way so assign a domain alias to a a non-production branch.

One solution would be to make a new site linked to the same repo with the consult branch set to be the production branch of the site. Then you can add any custom domain you want to the site and it will use the branch in you choose as production.

If there are other questions, please let us know.

Thanks Luke, adding a new site is a good solution I hadn’t thought of!

Just out of curiosity, is there a reason branch subdomains can’t be prefixed with www. Seems like a useful feature

Thanks again for your help

@jackow98 There’s not normally a need for a www in front of a subdomain because the subdomain is already a fully qualified domain name (FQDN).