Skip to Content
Menu
This question has been flagged
1 Reply
5145 Views

Hello all,

I'm using Odoo 16.x to do SEO. Initially when I prepare my own sitemap.xml with all URL in https. Once I uploaded to attachment (Setting -> Technical -> Database Structure -> Attachment). It shows correctly in https and I tested. Robots.txt and https://mydomain/sitemap.xml, it shows all URL in https.

But after 12 hours, odoo regenerated sitemap.xml in http not https. In fact my Nginx does well when http redirects to https. And website setting in Odoo all points to https

So anyone can share the experience how to solve or fix this sitemap.xml regeneration issue ? I think it is weird, because when there are new pages added to sitemap, it will be regenerated to http not https.


Best Regards,

Tom


Avatar
Discard
Author

Hello all,

The greatest issue is that once Odoo regenerated sitemap.xml, it will cover the previous sitemap I configured. Then I think it is no use. Even I set all the things myself. Later after 12 hours it will back to default.

So anyone who has encountered this issue before and fixed it ?

From Odoo official website
https://www.odoo.com/documentation/16.0/applications/websites/website/pages/seo.html

It mentioned that below:

You can customize the file robots in developer mode from Settings –> Technical –> User Interface –> Views (exclude robots, exclude some pages, redirect to a custom Sitemap). Make the Model Data of the view Non Updatable to not reset the file after system upgrades.

I tried to disallow some pages not to crawled and insert my sitemap in https in robots but it still shows http and default URL after 12 hours.

Because it is in website modules, so not sure whether below action can harm the system.
[Make the Model Data of the view Non Updatable to not reset the file after system upgrades.]

I also tried to create https://domain.com/sitemap_index.xml and sitemap_index.xml include other sitemap.xml as well. But another issue is that it seems Odoo attachment doesn't allow to create more than one sitemap.xml. Also there is no way to put the file directly on Odoo website like robots.txt and sitemap.xml.

I think if Odoo can read in this way, may work but still know how to disable automatic regenerated sitemap.xml for every 12 hours issue.

Best Regards,

Tom


Hello Tom, 

any progress on this? I'm having some difficulties with SEO on community 16 as well. 

I've actually written a module to fix the http to https, kind of got that sorted. 

My issue is with the sitemap not containing any images from the webshop. 

Did you have any luck with customizing robots.txt? (redirecting to custom sitemap/ after editing the default one making it non updateable)

Any feedback would be helpful because I'm not finding any other resources about this issue. 

Thanks, 
Filip

Best Answer

If you are using a reverse proxy like Apache or Nginx you need to set the proxy details in order Odoo to get the url as https. 

For Apache:

RequestHeader set X-Forwarded-Proto https
RequestHeader set X-Forwarded-Host example.com
ProxyPreserveHost On
ProxyRequests Off

For Nginx, put it in location or server block:

        proxy_set_header X-Forwarded-Proto https;
        proxy_set_header X-Forwarded-Host example.com;
        proxy_set_header Host $host;
Avatar
Discard
Related Posts Replies Views Activity
1
Apr 24
3246
0
Mar 24
1463
3
Jul 25
1065
2
Jul 25
3514
3
Jun 25
1442