directoryrobots.txtnoindex

robots.txt disallow /variable_dir_name/directory


I need to disallow /variable_dir_name/directory via robots.txt

I use:

Disallow: */directory Noindex: */directory

is that correct?


Solution

  • The following should work in your robots.txt:

    User-Agent: *
    Disallow: /*/directory
    

    Further reading from Google: Block or remove pages using a robots.txt file