How can I allow googlebot to crawl my sitemap? .htaccess

WeWontBeAlone

Regular Member
Joined
Jan 13, 2016
Messages
489
Reaction score
40
So I want google to be able to crawl my sitemap but I don't want other people to be able to see or view my sitemap, here's my current code


Order deny,allow
Deny from all
SetEnvIfNoCase User-Agent "Googlebot" goodbot

<Files "sitemap_index.xml">
deny from all
Allow from env=goodbot
</Files>

Currently this is giving a 403 forbidden error on google search console when I try to submit sitemap.
 
Solution 1 : Password protection
Solution 2 : Robots.txt
Solution 3 : Using .htaccess RewriteCond

Change URL in last line to your main site so that your site gets SEO ranking if someone linked in to your blocked site.
How would google be able to access it if I were to password protect?
 
Back
Top