تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
5214 أدوات العرض

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.

الصورة الرمزية
إهمال
أفضل إجابة

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

الصورة الرمزية
إهمال
الكاتب أفضل إجابة

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.

الصورة الرمزية
إهمال