Tips around robots.txt file and workarounds
Hello, and thanks for listening to SEO tips today.
Just last week a client asked me where the best place to put an XML sitemap file was, which made me curious as to whether there are best practices for robots.txt file locations as well.
When it comes to an XML sitemap file, the best practice is to have it at the root of the domain it covers, and usually, it’s at domain.com/sitemap.xml. BUT if you list the XML sitemap file and submit it via Google Search Console, Google doesn’t care where it’s located. So to repeat, you could load the sitemap file up into a subfolder, submit it to Google Search Console, and any URLs in there can be for any verified path on your account.
Related to robots.txt files, you also can host it anywhere, just as long as it 301 redirects to your domain (Source).
So that’s your tip for today – workarounds if you can’t host either your XML sitemap file or robots.txt in the “ideal” locations.
Thanks for listening. Come back tomorrow for another SEO tip.
Listen to the previous episode: March 2021 and why your site needs to be mobile friendly