How do I disallow specific page from robots.txt

前端 未结 4 1372
孤独总比滥情好
孤独总比滥情好 2020-12-06 09:03

I am creating two pages on my site that are very similar but serve different purposes. One is to thank users for leaving a comment and the other is to encourage users to sub

4条回答
  •  太阳男子
    2020-12-06 10:06

    You can also add a specific page with extension in robots.txt file. In case of testing, you can specify the test page path to disallow robots from crawling.

    For examples:

     Disallow: /index_test.php
     Disallow: /products/test_product.html
     Disallow: /products/     
    

    The first one Disallow: /index_test.php will disallow bots from crawling the test page in root folder.

    Second Disallow: /products/test_product.html will disallow test_product.html under the folder 'products'.

    Finally the last example Disallow: /products/ will disallow the whole folder from crawling.

提交回复
热议问题