Redirect www. to non www

Hi,

Aplogies if I an repeating my last post but I can’t work out how to redirect
My www. version of the domain to non www. version so google can validate my xml sitemap

Google search console gives a 404 http error as it tries to check the http www. version of the sitemap and it does not get a 301 redirect from

https://www.digital-search.netlify.app/

I have tried updating the _redirects and that does not work as www. is not an valid default domain
I can’t edit my domain settings as I using the free version and there is no editable cname or similar setting.

Please can someone advise how I can 301 redirect in this scenario.

Is there a way of doing this ? or is it impossible on the free version without a custom domain?

Without it it seems google will not validate my xml siteamap that I want it to crawl so I can test.

Pretty sure you need a custom domain for that,
it’s not even a plan thing, you only get one
subdomain (that is <site name>.netlify.app)
per site

but even then, doesn’t google crawl
from root path? Like it should still
find your sitemap?

@digital.search you have already created a thread regarding this: Www. redirect issue

As @hrishikesh explained, netlify.app subdomains are <site-name>.netlify.app and www.<site-name>.netlify.app is not configured and therefore not a valid domain.

There is no such setting for a netlify.app domain on paid tiers either.

As explained (again in thread linked above) there is no way to accomplish this.

When you added your site to Google, did you add it with or without the www? If you added it with it, you should remove it and add it again without. If you added it without, then I suggest the issue is with Google and you should try contacting them.

Alternatively, as @B00bleaTea suggested, you could use a custom domain.

1 Like

@coelmay @B00bleaTea thanks for you repsonse.
It does not look like there is a solution for this with free .app domain and it needs to be a custom domain where I can redirect the www.
I could register a www. property in google search console and verify but that would not work as I would want a 301 redirect in place.
I assume with a custom domain I could redirect www. and non www. versions or domains.
I also read somewhere that some of the free .app domains can be associated with spam so that may effect ability to test different user agent crawls . I’ll have to think about costs etc for a test site.

1 Like

When you register a custom domain and conigure it
with netlify it already shows you an option to
automatically configure www. subdomain from what I remember
when I registered mine, but if this is only a test
site there are many sites that provide free domains
for a couple of years, if you decide to make it legit
go for https://namecheap.com/ for example, they sell
domains for cheap :slight_smile: