Forum Moderators: phranque

Message Too Old, No Replies

Something wrong with this .htaccess file?

Getting Internal Server Error (500)

         

erlandc

3:10 am on Oct 13, 2006 (gmt 0)

10+ Year Member



Hi,

I'm new to this and was wondering what's wrong with my .htaccess file that I got from webmasterworld, with modifications done by myself.

I'm not a 100% webmaster or programmer. Just have a basics in HTML.

Any help would be much appreciated!

Thanks,

ec

<Files .htaccess>
order allow,deny
deny from ripe.net/whois
deny from 216.145.11.94
deny from 134.91.0
deny from 84.0.0
deny from 62.0.0
deny from 88.0.0
deny from 208.0.0
deny from 38.113.234.181
deny from 85.0.0
deny from 218.111.64.230
deny from 64.34.145.196
deny from 88.198.43.39
deny from 195.206.40.178
deny from 87.106.27.17
deny from 217.43.3.245
deny from 65.222.176.123
deny from 209.167.0.0 - 209.167.255.255
deny from 65.192.0.0 - 65.223.255.255
deny from 157.82.254.50
allow from all
</Files>
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_USER_AGENT} ^EmailSiphon [OR]
RewriteCond %{HTTP_USER_AGENT} ^EmailWolf [OR]
RewriteCond %{HTTP_USER_AGENT} ^ExtractorPro [OR]
RewriteCond %{HTTP_USER_AGENT} ^Mozilla.*NEWT [OR]
RewriteCond %{HTTP_USER_AGENT} ^Crescent [OR]
RewriteCond %{HTTP_USER_AGENT} ^CherryPicker [OR]
RewriteCond %{HTTP_USER_AGENT} ^[Ww]eb[Bb]andit [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebEMailExtrac.* [OR]
RewriteCond %{HTTP_USER_AGENT} ^NICErsPRO [OR]
RewriteCond %{HTTP_USER_AGENT} ^Teleport [OR]
RewriteCond %{HTTP_USER_AGENT} ^Zeus.*Webster [OR]
RewriteCond %{HTTP_USER_AGENT} ^Microsoft.URL [OR]
RewriteCond %{HTTP_USER_AGENT} ^Wget [OR]
RewriteCond %{HTTP_USER_AGENT} ^LinkWalker [OR]
RewriteCond %{HTTP_USER_AGENT} ^sitecheck.internetseer.com [OR]
RewriteCond %{HTTP_USER_AGENT} ^ia_archiver [OR]
RewriteCond %{HTTP_USER_AGENT} ^DIIbot [OR]
RewriteCond %{HTTP_USER_AGENT} ^psbot [OR]
RewriteCond %{HTTP_USER_AGENT} ^EmailCollector
RewriteRule ^.* - [F]
RewriteCond %{HTTP_REFERER} ^http://www.iaea.org$
RewriteRule!^http://[^/.]\.mysite.com.* - [F]

wm2007

9:40 am on Oct 18, 2006 (gmt 0)

10+ Year Member



Hi

It looks like you forgot space between RewriteRule and ! in the last line

erlandc

4:35 pm on Oct 18, 2006 (gmt 0)

10+ Year Member



Hi wm2007,

Thanks, still experimenting. Will let you
know how it goes.

Do you have an .htaccess files?

Thanks,

ec

jdMorgan

5:29 pm on Oct 18, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Even with the space restored, that rule won't work, because RewriteRule sees only a local URL-path, not a full URL. Also, since the referrer pattern is end-anchored, it won't match if a trailing slash or URL-path is appended. I'd suggest:

RewriteCond %{HTTP_REFERER} ^http://www\.iaea\.org
RewriteRule .* - [F]

Jim

The Contractor

5:47 pm on Oct 18, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Also:
<Files .htaccess> will only deny those entries from your .htaccess file. I'm sure you are trying to block them from the site - right?

If yes - you would use:

<Files *>
deny from ripe.net/whois
deny from 216.145.11.94
deny from 134.91.0
deny from 84.0.0
deny from 62.0.0
deny from 88.0.0
deny from 208.0.0
deny from 38.113.234.181
deny from 85.0.0
deny from 218.111.64.230
deny from 64.34.145.196
deny from 88.198.43.39
deny from 195.206.40.178
deny from 87.106.27.17
deny from 217.43.3.245
deny from 65.222.176.123
deny from 209.167.0.0 - 209.167.255.255
deny from 65.192.0.0 - 65.223.255.255
</Files>

To deny anyone from reading your .htaccess you would insert:

<Files .htaccess>
deny from all
</Files>

You can also shorten things like:
deny from 65.192.0.0 - 65.223.255.255

instead use:
deny from 65.192.0.0/11

There are a few in your deny from list that can be shortened up.

[edited by: The_Contractor at 5:56 pm (utc) on Oct. 18, 2006]

wm2007

1:38 am on Oct 19, 2006 (gmt 0)

10+ Year Member




Both jdMorgan and The Contractor is right, take their advise.

I looked for the "simplest" error (typos).

Sure I have a htaccess file, it the most updated file on my server ;-)

erlandc

4:00 am on Oct 24, 2006 (gmt 0)

10+ Year Member



Thank you guys!

I'll take your great advice and implement your tactics!

Much appreciated.

Hopefully, if I have another problem, it's good to know that you are here to help a newbie to this powerful way to control my sites from the bad guys!

ec