homepage Welcome to WebmasterWorld Guest from 54.227.40.166
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
htaccess - mod-rewrite stopped working
all the bad robots are getting full access
Busynut




msg:1509776
 4:21 am on Dec 12, 2002 (gmt 0)

I'm so embarrassed to be asking for help on this again. I implemented mod-rewrite rules in my htaccess file, and checked several "user-agents" via the wannabrowser site. Everything seemed to be working fine (getting 403 errors).

Tonight I just checked again at wannabrowser and every user-agent I inserted was allowed full access. I'm completely confused.

Here's my file:

#htaccess file for mysite.com

ErrorDocument 404 /404.html
ErrorDocument 500 /500.html
ErrorDocument 403 /403.html

IndexIgnore *

<Files .htaccess>
order allow,deny
deny from all
</Files>

RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} ^(-?¦[A-Z]{10})$ [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Bandit [NC,OR]
---more bad robots---
RewriteCond %{HTTP_USER_AGENT} ^Zeus [NC]
RewriteCond %{HTTP_REFERER} ^http://www.iaea.org
RewriteRule!^403.html$ - [F,L]

Can anyone identify what I've done wrong? Between the first time I checked user-agents at wannabrowser (and got the 403 errors which led me to believe all was okay).. and now... the only thing I've changed is I've added a few new user agents. Also, just this evening I uploaded the trap.pl script for bad spiders - but I'm quite sure that has nothing to do with this because I tested with and without the script in my cgi-bin at wannabrowser. At the moment - it seems anyone can do anything they want at my site! [very dismayed!]

I know the mod-rewrite issues have been reviewed over and over and over again and you're probably all tired of this... nonetheless, can someone help identify what I've done wrong?

Many thanks.

 

jdMorgan




msg:1509777
 4:36 am on Dec 12, 2002 (gmt 0)

Busynut,

Missing [OR] following zeus?

You need an [OR] on each RewriteCond except the last one for this to work as expected.

Jim

Busynut




msg:1509778
 6:40 am on Dec 12, 2002 (gmt 0)

OMG.... Jim I owe you big time. [hanging head in shame]

That was it. Duh!

Thank you so much for saving me from my own stoooopidity!

Sticky-mail me for whatever I owe you on this one... I'm pretty darn good at graphics/photos so if there's something I can do to repay your kindness please please don't hesitate to say so! (it would make me feel better to do something for someone!)

Busynut

jdMorgan




msg:1509779
 7:25 am on Dec 12, 2002 (gmt 0)

Busynut,

My pleasure - No charge... :)

Been there, done that myself - many times. I still get a 500-Server error about once a month from forgetting to escape the spaces! :o Luckily, it's late at night when the sites are mostly dead, and I always have the backup ready to restore in case of trouble.

Glad you got it fixed!
Jim

Busynut




msg:1509780
 3:02 pm on Dec 12, 2002 (gmt 0)

:)
Yep... I'm a much happier camper today - glad you're so watchful! Gonna have to brush up on my proofreading skills.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved