Forum Moderators: goodroi

Message Too Old, No Replies

Keeping bots out of one script

Is this valid?

         

trillianjedi

3:09 pm on Apr 6, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I need to keep bots out of a script that I can't put a NOINDEX or NOFOLLOW tag into (well, ok I could, but for a variety of reasons it would be a nightmare).

Can I just do this:-

user-agent: *
disallow: /somescript.php

.... as a means of keeping bots out of, for example:-

domain.com/somescript.php?stuff=trillianjedi&mode=force

I know that I can't do wildcards, but I wonder if this sort of "left side" check works?

TJ

Dijkgraaf

2:56 am on Apr 7, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, that is fine.
The disallow is for anything starting with what you specify.

g1smd

7:57 pm on Apr 9, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You can do that, and it will work, but people do go looking in robots.txt for filenames of scripts that they can then attempt to hack.

If you want to keep the filename a little more private then put the script in a folder and disallow that entire folder (not mentioning the actually script URL), and don't allow the folder to display a DirectoryIndex when accessed.

trillianjedi

10:32 am on Apr 10, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks guys.

If you want to keep the filename a little more private then put the script in a folder and disallow that entire folder (not mentioning the actually script URL), and don't allow the folder to display a DirectoryIndex when accessed.

That's a really good tip.... thanks. Good thinking.

TJ