Can't remember how to nest the ranges for this: 52.0.0.0 - 52.31.255.255
RewriteCond %{REMOTE_ADDR} ^............?
Anyone? Thanks
wilderness
3:55 pm on Jul 14, 2015 (gmt 0)
^52\.([0-9]|[12][0-9]|3[01])\.
and if necessary [OR]
keyplyr
7:59 pm on Jul 14, 2015 (gmt 0)
Thanks Don
lucy24
8:34 pm on Jul 14, 2015 (gmt 0)
Or, if you prefer, ([12]?\d|3[0-1])\.
:: wandering off to Apache docs to investigate persistent rumors of CIDR in a 2.4 RewriteCond ::
keyplyr
11:31 pm on Jul 14, 2015 (gmt 0)
What's a 2.4 RewriteCond?"
lucy24
12:09 am on Jul 15, 2015 (gmt 0)
Rumor has it Apache 2.4 recognizes CIDRs in mod_rewrite, presumably in some newly defined RewriteCond (of which there are many), but so far I haven't been able to find it and it remains a rumor :(
It is critical to only enable this behavior from intermediate hosts (proxies, etc) which are trusted by this server, since it is trivial for the remote useragent to impersonate another useragent.
[edited by: keyplyr at 2:57 am (utc) on Jul 18, 2015]
lucy24
2:55 am on Jul 18, 2015 (gmt 0)
TMS, you've got to stop changing masks. It confuses me ;)
If "peer IP address" means "address in CIDR form" then I guess that's it. (I have actually looked at both those pages, but have never been able to figure out what they mean. My server is not yet on 2.4, so I can't simply hop over to my test site and experiment.)
TheMadScientist
3:01 am on Jul 18, 2015 (gmt 0)
TMS, you've got to stop changing masks. It confuses me ;)
LOL, but honestly I haven't changed since I "returned" -- I just haven't posted at all in months.
Added: I can't check it right now either, but it's one of the few new variables I see available to mod_rewrite, and based on the docs does seem to return a remote IP in CIDR format.
keyplyr
4:15 am on Jul 18, 2015 (gmt 0)
Well if the Apache mod_remoteip module needs to be loaded on the server, it ain't at any shared machines at my host but I'll check a couple other shared hosts for clients. I'd really like to test this. I especially like the mapping for IPv6 to IPv4.
lucy24
4:58 am on Jul 18, 2015 (gmt 0)
Is your server on 2.4? I think it's a brand-new mod.
keyplyr
6:11 am on Jul 18, 2015 (gmt 0)
My personal site is at the same host as yours. I know the older disk machines, where my site is, don't per their Apache Mod list in the WIKI (which hasn't been updated since the Mesozoic Era so there's nothing regarding newer Apache upgrades.)
The newer shared SSD servers (where I am waiting to be moved) *might* but I see no evidence; more likely the dedicated plans where you can self-install.
lucy24
8:02 am on Jul 18, 2015 (gmt 0)
Somewhere our host has got a bit of blahblah saying-- with a straight face-- that they can't tell us what exact Apache version we're on, for "security reasons". And then they turn right around and give instructions for that little function that will spit out a full list of every mod that's available to your site.
And, of course, you can go to the free lookup of your choice, plug in your domain name, and get told exactly what kind of server it's on. Or just force an error and see what Apache version number is in the default error message.
This all makes perfect sense to somebody, somewhere.
keyplyr
11:31 am on Jul 19, 2015 (gmt 0)
Well dig this... when I signed up, I called them on the phone. I called Brea, California (they say Los Angels, but it's really Brea.) I liked the idea they were just an hour's driving distance away (I don't know why I liked that, I just did.) So I moved my site there.
Then a month or two later they move all the web sites to their new DC in Virginia... Virginia! The only thing in my account they leave in Brea is their webmail, which I don't use. This was very upsetting :)
Now, logistically it is much better for the file servers to be on the East coast than the West, but still...
lucy24
6:48 pm on Jul 19, 2015 (gmt 0)
If you accept their "cloud" offers (to date I've always responded by putting my fingers in my ears and humming loudly) your physical server could be absolutely anywhere :)
Do they really claim to be in LA? I always see Brea. But then, I noticed a while ago in a different context that if you're anywhere in the LA/Orange/SanFernando conurbation you will identify yourself as "in LA", while nobody would ever claim to be "in San Francisco" unless you are in the actual, named city. Go figure.
An hour's drive in LA is, what, about three miles?