Forum Moderators: phranque

Message Too Old, No Replies

denied gets in

         

wilderness

4:36 am on Mar 26, 2008 (gmt 0)

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



I've chamged hosts for one of my sites after many years.

The new host seems to have more stringent requirements for rewirtes, perhaps different versions of something or another.
Some SetEnvIf's result in 500 errors.
In any event it's been a fun transition ;)

As a result, I've combined some formerly individual lines into a multiple line.
For some reason, I've seen two that I have included in similar lines (not shown here) get access and 200's.
I've rechecked and they are clearly denied

RewriteCond %{HTTP_USER_AGENT} ^(bot¦Bravo¦Bridgetown¦BuyGet¦cfetch¦CFN¦Cold¦Convera¦Cosmix¦Cow) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^(stat¦Strider¦TAMU¦Tarantula¦Tcl¦Test¦ThemeLink¦Theophrastus) [NC]
RewriteRule .* - [F]

Is the problem with "OR"?
It's the only thing I see?

Thanks in advance.

jdMorgan

1:06 pm on Mar 26, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



An example line from your access log might be helpful.
Look for a missing [OR] on anything but the last RewriteCond.
Check your start and end-anchoring on the patterns.

Jim

wilderness

2:20 pm on Mar 26, 2008 (gmt 0)

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



Hey Jim,
The lines are really simple and I simply don't see any syntax errors.

There are two sections ("begins with" and "contains") of UA with 10 per line and too provide them all here would be useless. Besides the line wrap would make difficult reading.

One denial from the "Begins with" was allowed and one denial from the "contains" was allowed.

I'm simply stumped by the simplicity of it all.

I've had to eliminate some "ends with"--(SetEnvIf) lines that functioned for years on the old host, however return 500's on the new host. I made some extensive attempt at locating and/or correcting syntax errors, however nothing worked.

BTW, I don't recall ever attempting to use the error logs in such a manner as I did a few days ago.
When the 500 was returned, the error logs provided and IP range with a syntax error. (normally, I'm in such a rush to get the site back up when a 500 takes place, that a few seconds in the error logs is hardly considered).

wilderness

7:00 pm on Mar 27, 2008 (gmt 0)

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



Jim,
Any idea if the following could be the culprit?
Would it prevent what precedes or follows from working?
(line shortened)

RewriteCond %{HTTP_USER_AGENT} (Name1¦Name2¦\+NT\+¦Name3¦Name4)[NC,OR]

Don

jdMorgan

2:30 am on Mar 28, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It could, because a space is required ahead of [flags]. Have you fixed it and tested it?

Jim

wilderness

3:10 am on Mar 28, 2008 (gmt 0)

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



many thanks Jim.

The entire 14-line section of my file was lacking that space.
Made the correction.

Will need to watch it close to determine if that was the problem.

I did locate the other error, which was that I had "envolk" in a "begins with" and it visited with a "contains". Thus I made that adjustment.

Many thanks again.

Don

edited:
TESTED and solved. I forget about that plug-in that you must use in your sleep ;)