Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
5197 Vistas

Hi, we are using Odoo 16 and we have problem with website generated in Odoo. Robots.txt have following content:

User-agent: *
Disallow: /

Even when I change the content of robots.txt in webpage Settings to:

Disallow: /web/login
Allow: *

I can see in the website source code: 
meta name="robots" content="noindex"

How to solve it?

Many thanks in advance.

Avatar
Descartar
Mejor respuesta

I had the same issue. This is how I fixed it.

  1. Go to Website > Site > HTML/CSS Editor   

  2. Click Edit HTML Anyway  

  3. From the first dropdown, select XML (HTML) 

  4. From the second dropdown, select Main Layout . (The template ID of the main layout is website.layout )   

  5. Go to line 44.

  6. Find where it says  (website.domain and not website._is_indexable_url(request.httprequest.url_root)) 

  7. Replace  request.httprequest.url_root  with 'https://your-domain.com' (you must use single quotes)  

  8. Save and close the file

Avatar
Descartar
Autor Mejor respuesta

Just for reference, I found the solution. Problem was, that Odoo is internally using http protocol and we had in the Website Settings in the field Domain URL with HTTPS, which was working with the combination of Nginx proxy, but it didn't fit the condition stated here:

https://github.com/odoo/odoo/blob/df3811e745cec7375ae4eba4ac2a82128fa6dab0/addons/website/views/website_templates.xml#L2401


So, when I changed the Domain URL from https://our-domnain.com to the http://our-domain.com, it worked.

Avatar
Descartar