Ignore urls in robot.txt with specific parameters?

前端 未结 3 1198
误落风尘
误落风尘 2020-12-02 16:41

I would like for google to ignore urls like this:

http://www.mydomain.com/new-printers?dir=asc&order=price&p=3

All urls that have the parameters dir,

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-02 17:09

    You can block those specific query string parameters with the following lines

    Disallow: /*?*dir=
    Disallow: /*?*order=
    Disallow: /*?*p=
    

    So if any URL contains dir=, order=, or p= anywhere in the query string, it will be blocked.

提交回复
热议问题