Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tlug] htaccess, rewritecond, and wildcards!! [help!]



I need you .htacecss or PERL guru's...

long story short:

 I am using an incredibly inefficient way to limit visitors to my site.
I send everyone to a "site down" page except for those ip's that are
on my "ok" list. (one day I will change this.. but for now... keeping
it simple!)

I have recently tried to add some hostnames to the equation (some of
my visitors are on dynamic ips, so even though the hostname will
remain almost the same, the ip # could change considerably.)

hence, I am trying to add wildcare statements to my conditions.

Here is what I want to do:

If the hostname has saitama or (.saitama.) somewhere in it, I would
like it to come up false.

I have tried the following:

RewriteCond %{REMOTE_HOST} !(*.)saitama(*.) [NC]

to no avail.

I have also tried things like

RewriteCond %{REMOTE_HOST} !*saitama* [NC]
RewriteCond %{REMOTE_HOST} !saitama [NC]
RewriteCond %{REMOTE_HOST} !^.saitama. [NC]
(as you may have noticed, I have no idea what the "^" does, but it
seems to work sometimes.)

now I know the condition itself works because it works fine with IPs
and full hostnames. Is theer anyway to get a wildcard statement in
there so if it finds "saitama" (or whatever) in there, it would meet
the condition?

I am hoping someone can help.
Thank you!

David


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links