Contenuto Robots.txt

Test Configuration

🤖 Suggerimenti Robots.txt

📋 Sintassi Base

  • User-agent: Specifica a quale crawler si applicano le regole
  • Disallow: Indica al crawler di non accedere a URL specifici
  • Allow: Sovrascrive un Disallow per permettere l'accesso a URL specifici
  • Sitemap: Specifica la posizione della sitemap XML
  • Crawl-delay: Imposta il tempo tra le richieste del crawler

🎯 Pattern Matching

  • * (wildcard): Matches any sequence of characters
  • $ (end anchor): Matches the end of the URL
  • /path/: Matches URLs starting with /path/
  • /*.pdf$: Matches all PDF files
  • /dir/*: Matches everything in a directory

⚠️ Best Practice

  • Posiziona sempre robots.txt nella directory root
  • More specific rules take precedence over general ones
  • Le regole Allow sovrascrivono le regole Disallow della stessa lunghezza
  • Robots.txt è pubblicamente accessibile - non usare per la sicurezza
  • Testa il tuo robots.txt prima di deployare in produzione
  • Usa Google Search Console per validare il tuo robots.txt