Hatchi Roku
Hatchi Roku

Reputation: 1004

Lighthouse - robots.txt error Syntax not understood

When I test my website with Lighthouse it gives me that it found 50 errors with robots.txt, and I don't know what are the problems and how to solve them. It shows the content of my index.html file with error for each line. What is the problem? And how to solve it??

Upvotes: 2

Views: 2534

Answers (1)

Patrickkx
Patrickkx

Reputation: 1870

Well, had a similar problem lately. All I had to do was to generate robots.txt manually. Just google it - generate robots.txt. Then upload it to your app. Would be also nice to generate sitemap.xml.

If u're too lazy, u can just copy and paste following code:

User-agent: *
Allow: /
Disallow: /example  // example is directory u want to exclude, 
                    // if u dont want to exclude anything, just remove this line

Sitemap: https://example.com/sitemap.xml

Upvotes: 4

Related Questions