Welcome to WebmasterWorld Guest from 54.166.33.25

Forum Moderators: goodroi

Robots.txt conundrum!

   
2:05 pm on Dec 30, 2004 (gmt 0)

10+ Year Member



I don't want the contents of a specific directory spidered however there is a subdirectory of this directory whose contents I would like spidering, is it possible to disallow the directory and still allow the subdirectory contents?
2:07 pm on Dec 30, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



hi
why dont you do the reverse

allow for the directory
disallow for the other subdiretories and this will do what u want

hope this helps
regards

6:32 pm on Jan 30, 2005 (gmt 0)

10+ Year Member



IIS yes...can't speak for others. Disallow on the main and apply to all subs. Then go in an open the subs. make sure you reference it somehow though or it will not be found.
6:36 pm on Jan 30, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



is it possible to disallow the directory and still allow the subdirectory contents?

No - robots.txt standard calls for case-insensitive match of given disallowed string in a URL that is being checked against robots.txt: since subdirs will all have main dir matched, it means you will disallow access to everything.

You can try however disallowing access to specific files in that main directory ie:

Disallow: /maindir/index.php

This will not be practical for lots of files (and you can't use regular expressions or wildcards in robots.txt), so you might be better off moving subdirs you want to index elsewhere or allowing to index everything.

 

Featured Threads

Hot Threads This Week

Hot Threads This Month