Return-Path: X-Original-To: apmail-httpd-users-archive@www.apache.org Delivered-To: apmail-httpd-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6212210A25 for ; Tue, 18 Feb 2014 21:52:24 +0000 (UTC) Received: (qmail 40005 invoked by uid 500); 18 Feb 2014 21:52:21 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 39935 invoked by uid 500); 18 Feb 2014 21:52:21 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 39927 invoked by uid 99); 18 Feb 2014 21:52:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Feb 2014 21:52:20 +0000 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests=NORMAL_HTTP_TO_IP,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: unknown (athena.apache.org: error in processing during lookup of eggert.ehmke@berlin.de) Received: from [85.214.54.134] (HELO mail.eehmke.de) (85.214.54.134) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Feb 2014 21:52:16 +0000 Received: from wookie.localnet (unknown [IPv6:2001:6f8:1c00:847e:358e:d4b:5141:13bb]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: eggert@eehmke.de) by mail.eehmke.de (Postfix) with ESMTPSA id 65DD15FA670 for ; Tue, 18 Feb 2014 22:51:55 +0100 (CET) From: Eggert Ehmke To: users@httpd.apache.org Date: Tue, 18 Feb 2014 22:51:54 +0100 Message-ID: <2834828.uBcJKvZnbv@wookie> User-Agent: KMail/4.12.1 (Linux/3.11.0-15-generic; KDE/4.12.1; x86_64; ; ) In-Reply-To: References: <4857020.0WRJJIyXcM@wookie> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8" X-Virus-Checked: Checked by ClamAV on apache.org Subject: Re: [users@httpd] Rewrite problem solved In the end I managed to solve the problem only with rewrite rules. The solution might not be perfect, but it works. # send back requests from the old server RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} ^http://123.123.123.123:8080/site/ [NC] RewriteRule ^/(.*) http://123.123.123.123:8080/site/$1 [L,R] # all requests to oldserver RewriteRule ^/oldserver/(.*)$ http://123.123.123.123:8080/site/$1 [L,R] RewriteCond %{HTTP_REFERER} !^http://123.123.123.123:8082/site/ [NC] RewriteRule ^/(.*) ... (rewrite to local zope server) the key seem to be the capture of HTTP_REFERER, because REMOTE_ADDR was not usable. -ee Am Montag 17 Februar 2014, 19:39:50 schrieb Yehuda Katz: > Your best bet might be to do your own reverse proxy to the old server which > will allow HTTPD to rewrite the links for you. > Rewrite rules are not appropriate for this situation. > > Look at ProxyPass and ProxyPassReverse. > > - Y > > On Mon, Feb 17, 2014 at 7:05 PM, Eggert Ehmke wrote: > > I took over a domain that was previosly hosted on anther server. The new > > web > > portal works fine. We still need to access the old portal, which is > > accessible > > via a nonstandard port like http://oldserver:8080. However, the old web > > portal > > contains internal absolute links, which now of course point to the new > > portal. > > So the old portal is broken. > > > > I tried to implement some rewrite rules to prevent the new server to > > accept > > > > requests from the old server, but this does not seem to work. I tried: > > RewriteCond %{REMOTE_ADDR} ^123.123.123.123$ > > RewriteRule ^/(.*) http://123.123.123.123:8080/$1 [P] > > > > RewriteCond %{REMOTE_ADDR} !^123.123.123.123$ > > RewriteRule ^/(.*) http://localhost:8090... > > > > (123.123.123.123 represents the IP of the old server). So if the request > > comes > > from the old server, send it back. If not, process the process local. > > > > The problem is that REMOTE_ADDR does not match the IP of the other server. > > There might be a proxy between. > > > > Is there a solution, or did I shoot into my knee? > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org > > For additional commands, e-mail: users-help@httpd.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org