How to no index specific URLS?

后端 未结 2 829
无人共我
无人共我 2020-12-12 01:28

I was searching around on how to no index specific URLs but I havent found any specific info on the following.

By adding the below



        
2条回答
  •  猫巷女王i
    2020-12-12 01:52

    By using robots.txt, you can disallow crawling.

    By using meta-robots (or the HTTP header X-Robots-Tag), you can disallow indexing.

    If you intend to forbid indexing, you shouldn’t disallow the URLs in robots.txt, otherwise bots will never know that you don’t want these URLs to be indexed.

    In case you want to disallow crawling, you could use this robots.txt:

    User-agent: *
    Disallow: /REF-123
    

    This would apply to all URLs whose paths start with REF-123 (case-sensitive!).

    In case you want to disallow indexing, you could add to all these pages this meta element

    
    

    or send the corresponding HTTP header X-Robots-Tag:

    X-Robots-Tag: noindex
    

提交回复
热议问题