cancel
Showing results for 
Search instead for 
Did you mean: 

Google Sitemap, wrong location, write errors

Google Sitemap, wrong location, write errors

To whom it may concern.

Having trouble with adding sitemap.xml to root. IE: example.com/sitemap.xml. Error: Root is not writable. Alternative: example.com/sitemap/sitemap.xml. This is not acceptable: Please read documentation:

We require the whole website to be indexed and crawled with the HELP of the sitemap. Thus the sitemap needs to be in the root.

 

Furthermore:

  • If possible, the sitemap.xml can be writable in the root, thus allowing the cron to edit the file.
  • However, the developers of our website say that the cron deletes and recreates the file which makes the above option not possible.

 

 

Does the cron update the sitemap file be deleting and recreating?


Please assist. Thank you kindly.

 

 

 

 

 

 

 

 

 

 

 

3 REPLIES 3

Re: Google Sitemap, wrong location, write errors

Hi @rooki4life,

Yes, the new sitemap will generate everytime you run the Cron.

I am not sure where you are setting the cron job.

1. If it is through SSH, you can add one more command to set the permission to the file as soon as the sitemap cron is finished.

You can ask your developers do that. Implementation depends on them. Below example is just a hint.

https://serverfault.com/questions/360866/setting-up-a-cron-job-that-does-a-chmod-chown?answertab=vot...

2. If cron is set through Cpanel, you can reach to hosting support to apply file permissions once the cron ends.

--------
Give Kudos if it helped or Accept it as solution


Re: Google Sitemap, wrong location, write errors

Hi @kalyanchakri.

Thank you greatly for the reply.

 

My developers are reporting, that because the sitemap gets deleted and recreated, the whole root needs to have writable permissions - which poses a security risk. Thus it appears that the extension is designed rather to delete, generate and replace the existing file, rather than running an update script.

 

Our sitemap file will have to be updated on a weekly basis, thus we do not want to manually
move the sitemap to the root after every cron update.

 

I require to highlight again, that the sitemap becomes invalid should it be in a subfolder and the URLs of the sitemap are from the root.

What is our options.

Re: Google Sitemap, wrong location, write errors

Hi @rooki4life,

Sorry, I don't understand why the whole root needs to be writable. Writable permissions can be given only to the sitemap file.

I never tried to keep the sitemap in a sub-folder but generating the links from the root. I don't think that this will work.

Please check this link https://www.sitemaps.org/protocol.html#location

--------
Give Kudos if it helped or Accept it as a solution