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 25567C8FE for ; Wed, 16 May 2012 12:07:01 +0000 (UTC) Received: (qmail 69391 invoked by uid 500); 16 May 2012 12:06:58 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 69311 invoked by uid 500); 16 May 2012 12:06:56 -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 69272 invoked by uid 99); 16 May 2012 12:06:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 May 2012 12:06:55 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_NEUTRAL,URI_OBFU_WWW X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [132.246.15.89] (HELO nrccenhts1.nrc.ca) (132.246.15.89) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 May 2012 12:06:47 +0000 Received: from NRCWSTHCM1.NRC.CA (132.246.216.66) by nrccenhts2.nrc.ca (132.246.15.89) with Microsoft SMTP Server (TLS) id 8.3.245.1; Wed, 16 May 2012 08:06:25 -0400 Received: from NRCCENMB1.nrc.ca ([132.246.15.91]) by NRCWSTHCM1.NRC.CA ([132.246.216.66]) with mapi; Wed, 16 May 2012 05:06:24 -0700 From: "Desilets, Alain" To: "users@httpd.apache.org" Date: Wed, 16 May 2012 05:06:24 -0700 Thread-Topic: Redirecting a domain to another using Rewrite rules Thread-Index: AQHNM1xQ4tmDIpLwLUOiwXNRDpWdNQ== Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: [users@httpd] Redirecting a domain to another using Rewrite rules I need to forward a domain www.wiki-translation.com to a different location= wiki-translation.wiki4us.com, while preserving the original url.=20 I have been trying to do this for 30 mins now, using Rewrite rules, and not= hing works. For example, thje Parked domains CPanel functionality created the following= lines in my .htaccess file: --- RewriteCond %{HTTP_HOST} ^wiki\-translation\.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.wiki\-translation\.com$ RewriteRule ^/?$ "http\:\/\/wiki\-translation\.wiki4us\.com\/" [R=3D301,L] --- This works somewhat, in the sense that it redirects www.wiki-translation.co= m to wiki-translation.wiki4us.com. But it does not preserve the original UR= L. I also tried this replacing the R flag with a P (proxy) flag: --- RewriteCond %{HTTP_HOST} ^wiki\-translation\.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.wiki\-translation\.com$ RewriteRule ^/?$ "http\:\/\/wiki\-translation\.wiki4us\.com\/" [R=3D301,L] --- But it yields the error: --- Proxy Error The proxy server received an invalid response from an upstream server. The proxy server could not handle the request GET /. Reason: DNS lookup failure for: wiki-translation.wiki4us.com Additionally, a 404 Not Found error was encountered while trying to use an = ErrorDocument to handle the request. --- Then I tried this=20 --- RewriteCond %{HTTP_HOST} ^wiki\-translation\.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.wiki\-translation\.com$ RewriteRule ^/?$ "http\:\/\/www\.wiki4us\.com\/wiki\-translation\/" [P,L] --- where www.wiki4us.com/wiki-translation/ is the actual location that the sub= domain wiki-translation.wiki4us.com points to. This one worked kindof. It does point to the right location, and preserves = the original url www.wiki-translation.com. But the page comes out looking w= rong, presumably because all the CSS files are not accesible as www.wiki4us= .com/wiki-translation/*.css (just as wiki-translation.wiki4us.com/*.css). D= unno why. Any advice you may have will be greatly appreciated. Thx.= --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org