Re: content being served on the basis on incoming IP

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

 





On Thu, 13 Mar 2008, Szymon Bakowski wrote:

I was just wondering about in order to find a solution to my problem
but haven`t come up with final solution yet: what i am after is to be
able to serve the content of different directories after hitting the
same IP based on incoming IP. I was thinking about mod_proxy but am
not sure if this is the way to follow. Also, SSL may be involved and
here I suppose my idea may possibly fail ? All suggestions more than
welcome.

You should be able to match for REMOTE_ADDR in rewrite rules, and take it from there to access different "physical" directories. Say, something like:

RewriteCond %{REMOTE_ADDR}	10.1.1.1	[NC]
RewriteRule ^/(.*) http://somehost.example.com/dir1/$1 [P,L]
RewriteCond %{REMOTE_ADDR}      10.1.1.2        [NC]
RewriteRule ^/(.*)              http://somehost.example.com/dir2/$1
[P,L]

etc. (You don't "really" need proxying, unless you access another host of course.) This is from memory, didn't test it. I also think you may be able to save the remote address to a variable and do something with that in the "target" url.

Hope this helps.


Best wishes,
Nils

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux