Forum Moderators: bakedjake
Is it possible to pass query string arguments along with a URL, to get to a page in a directory that is password-protected via .htaccess? E.G.:
http-colon-slash-slash-mysite.com/somedir/page.html?
userid=thing1&password=thing2
This may sound like an odd request, but I want to keep spiders out of the dir (they don't always abide by robots.txt), yet make it easier for a select group of people to get to the page, by allowing them to skip the usual userid/password dialog box.
Thanks!
Perry
...should work (replacing the asterisk with a colon, of course). But you run into a catch-22 here. If you're doing this for the intention of blocking robots from crawling that directory, yet you're making this URL available (or advising people to use it), then robots can follow this URL just as easily as they could the previous one that was not password-protected.
If your primary intention is to keep robots out, I think your best bet is to use a login script that uses a cookie that doesn't expire when the user closes their browser. This will allow them continuous access to that section of the site without requiring them to login. If they click a logout link, however, the cookie is removed.
The other possibility is to use a form with method POST to get to the protected directory. I don't know of any robots (but there may be some) that will follow a POST response.. because the results are usually dynamic, and so the resulting content is useless to the robot.