You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Albert Jagnow <al...@uiowa.edu> on 2001/12/19 23:58:41 UTC

Client IP changes after mod_rewrite [R]

I have two name virtual hosts both using apache 1.3.20 on the same
system. One is my primary site that serves all the content. The other is
a domain name that was setup as a short name to direct users to a
specific application on the primary site. For example
www.otherdomain.com/test will redirect users to
www.myprimarysite.com/long/path/to/an/application?withoption=test. This
redirect is done using mod_rewrite in the www.otherdomain.com virtual
host directive with some rewrite rules and the [R] option. Everything
seems to work fine most of the time, however yesterday I had a user
report that the www.otherdomain.com/test url would not work for them.
After looking at the apache logs here is what I found:

Log for www.otherdomain.com
-------------------------------
24.4.253.100 - - [18/Dec/2001:19:01:25 -0600] "GET /test HTTP/1.0" 302
354 
"-" "Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; Win 9x 4.90;
AtHome020)"

24.4.253.100 - - [18/Dec/2001:19:01:44 -0600] "GET /test HTTP/1.0" 302
354
"-" "Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; Win 9x 4.90;
AtHome020)"
-------------------------------

Log for www.myprimarysite.com
-------------------------------
24.4.254.162 - - [18/Dec/2001:19:01:26 -0600] "GET
/Apps/WebObjects/MyApplication.woa/wa/goTo?area=test HTTP/1.0" 200 10807
"-" "Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; Win 9x 4.90;
AtHome020)"

24.4.254.162 - - [18/Dec/2001:19:01:44 -0600] "GET
/Apps/WebObjects/MyApplication.woa/wa/goTo?area=test HTTP/1.0" 200 10807
"-" "Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; Win 9x 4.90;
AtHome020)"
-------------------------------

You will notice that the ip address for the first request does not match
the ip address for the request after the redirect.  The user reported
that when they entered the url www.otherdomain.com/test nothing
happened. I checked the log files back to the start of the month and saw
this same thing 50 or so other times. I am wondering are all these users
having this same problem or is this client ip switch on a redirect a
common thing with ISPs like MSN, AOL, and @home, which is where the
other requests seemed to come from?  Is this particular problem
something with the users machine/ISP or something I can fix on my
server?  Could someone explain to me what is going on here or point me
in the right direction to figure this out?

-----------------------
Albert Jagnow
Web Developer
The University of Iowa Foundation 

---------------------------------------------------------------------
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@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: Client IP changes after mod_rewrite [R]

Posted by Joshua Slive <jo...@slive.ca>.
> From: Albert Jagnow [mailto:albert-jagnow@uiowa.edu]

> You will notice that the ip address for the first request does not match
> the ip address for the request after the redirect.  The user reported
> that when they entered the url www.otherdomain.com/test nothing
> happened. I checked the log files back to the start of the month and saw
> this same thing 50 or so other times. I am wondering are all these users
> having this same problem or is this client ip switch on a redirect a
> common thing with ISPs like MSN, AOL, and @home, which is where the
> other requests seemed to come from?  Is this particular problem
> something with the users machine/ISP or something I can fix on my
> server?  Could someone explain to me what is going on here or point me
> in the right direction to figure this out?

Yes, there are several major ISPs that use load-sharing proxies such that
two "nearby" requests might come from different proxy servers.  You can't
count on all requests coming from the same IP.  They should still follow the
redirect, unless their proxy servers have a problem.

Joshua.


---------------------------------------------------------------------
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@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org