![]() |
Cookies and Protect directory
I'm trying to protect a directory for everybody that visits through the backdoor (SE's, Bookmarks), they have to visit a warning page first. I have been trying some stuff with cookies and htaccess, but cannot get it to work properly.
Anybody know a good site where that info is explained? It must not be password protected, I see plenty of info on that subject, it is just a page where the cookie is set before entering the site, no cookie --> no site. |
Naughty, this problem is currently being discussed here along with an example script: http://www.tgswupdates.com/cgi-bin/i...rum=3&topic=75
Btw, you could probably just have .htaccess look for the accept-cookie header without bothering with an actual cookie being set at first. D'oh. Different issue. Nevermind that second part. The auto-set username/password cookie scripts will work though. |
Mark, that is how I got the idea. That script up there doesn't work for me, so I thought I'd look for more info to try to solve it.
Did it work for you? |
I haven't tried fooling around with that script as I just found out about the discussion after Vince posted on CC's board. .htaccess and cookies is basic stuff but I can't seem to remember that shit :( (damn pot addiction!) and all my bookmarks on the subject are on another machine.
Is it the script that sets the cookie that's not working or the .htaccess? Stand back, my head is about to explode. :eek7 |
Actually, this works:
RewriteEngine On RewriteCond %{HTTP_COOKIE} !^.*login=pass.*$ RewriteCond %{HTTP_REFERER} !^http://([a-z0-9-]+\.)*naughtysecrets.co.uk/ [NC] RewriteRule .* http://www.naughtycelebs.co.uk/gallery/ [R,L] BUT, as soon as I change it to this, it stops working: RewriteEngine On RewriteCond %{HTTP_COOKIE} !^.*login=pass.*$ RewriteCond %{HTTP_USER_AGENT} ^.*Buddy.*$ [OR] RewriteCond %{HTTP_USER_AGENT} ^.*Whacker.*$ [OR] RewriteCond %{HTTP_USER_AGENT} ^.*FileHound.*$ RewriteCond %{HTTP_REFERER} !^http://([a-z0-9-]+\.)*naughtysecrets.co.uk/ [NC] RewriteRule .* http://www.naughtycelebs.co.uk/gallery/ [R,L] I'm puzzled:( |
Weird. Just the sitesnagger user agent entries breaks it?
Bowing out to the .htaccess gurus... |
| All times are GMT -7. The time now is 04:31 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123