Forum Moderators: open

Message Too Old, No Replies

SetEnvIf User-Agent

         

wilderness

2:54 pm on May 16, 2010 (gmt 0)

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



Might anybody recall if it's possible to use multiple keywords on a single line, which would react the same as an OR (|) in mod_rewrite?

EX:
SetEnvIfNoCase User-Agent word1 word2 word3

jdMorgan

10:37 pm on May 28, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



SetEnvif uses regular expressions, so the notation is identical -- unless the pattern includes spaces. If the pattern includes spaces, they must be escaped as in mod_rewrite, but in addition, the whole string needs to be surrounded by quotes.

SetEnvIfNoCase User-Agent "^(Toata\ dragostea$|libwww-perl/)" varname

Jim

tangor

11:55 pm on May 28, 2010 (gmt 0)

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



Thanks, Jim! Just want to confirm that is a "pipe" character should I need to use multiples in SetEnvIfNoCase...

wilderness

12:46 am on May 29, 2010 (gmt 0)

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



tangor,
Yes to pipe character.

SetEnvIfNoCase User-Agent (word1|word2|word3) varname

------------------
Many thanks Jim.

Jonesy

9:47 pm on May 29, 2010 (gmt 0)

10+ Year Member Top Contributors Of The Month



hmmmmmmmm...
Did I somehow miss the announcement that WebmasterWorld no longer converts
a 'true' pipe character into a 'broken' pipe character in posts?

wilderness

11:08 pm on May 29, 2010 (gmt 0)

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



Did I somehow miss the announcement


Personally speaking, I don't recall seeing an initial/official announcement that the pipe character was forum-broken!

Instead, the forum broken character was known fact, and most everybody added a notational line when using the keyboard-pipe-character.

jdMorgan

5:33 am on Jun 5, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, that got fixed several months ago -- thankfully. :)

Jim