Return-Path: Delivered-To: apmail-httpd-users-archive@www.apache.org Received: (qmail 56511 invoked from network); 13 Nov 2007 17:26:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Nov 2007 17:26:55 -0000 Received: (qmail 63164 invoked by uid 500); 13 Nov 2007 17:26:33 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 63148 invoked by uid 500); 13 Nov 2007 17:26:33 -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 63131 invoked by uid 99); 13 Nov 2007 17:26:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Nov 2007 09:26:33 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of sweetwatergeek@googlemail.com designates 64.233.162.233 as permitted sender) Received: from [64.233.162.233] (HELO nz-out-0506.google.com) (64.233.162.233) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Nov 2007 17:26:34 +0000 Received: by nz-out-0506.google.com with SMTP id i1so1226488nzh for ; Tue, 13 Nov 2007 09:25:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=N/D4f1ZhpDhidpzKeaiJRCBF+4FC9033t3LwABJdXBY=; b=owA9FCAuZpEC8fu76DXjjVV6UBcVGmCuMk063WpoNy94zy5GFkPyy1K4VVWFQNzkfdwW07JcOWwwVXvPzobVv6TpiStU+7DhGpxO4JASXU7KsUvczIZ+DTJkL57vxVogsQUZ3P07vPuYrtWx9brRajRy/A3YeuPp+fw/ErxaBBs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=hsAZbcxzyhsdRyGuVA3GNFRW3QI7H+9tO9rXb3CFQ8gt8naEypIL3G5SvRKYFgEk86w+KjVeXATLFkaz3pkJojs4900jURDqjrZMxkknodwKaKOd+FuAxbFvxSdLxrEXqVXW/hH2/FreMC5iFsgDXSWiNN9nHEEF9lCXMYoEbFw= Received: by 10.114.201.1 with SMTP id y1mr236394waf.1194974755748; Tue, 13 Nov 2007 09:25:55 -0800 (PST) Received: by 10.114.95.6 with HTTP; Tue, 13 Nov 2007 09:25:55 -0800 (PST) Message-ID: <787fc380711130925x7378f9afp383e45a81cae10d1@mail.gmail.com> Date: Tue, 13 Nov 2007 17:25:55 +0000 From: Martijn To: users@httpd.apache.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-Virus-Checked: Checked by ClamAV on apache.org Subject: Re: [users@httpd] Mod_Rewrite from old dynamic page On Nov 13, 2007 5:10 PM, Ki Song wrote: > How would I write a mod_rewrite rule for the following: > OLD URL: http://store.knifecenter.com/pgi-ProductSpec?productSKU > NEW URL: http://www.knifecenter.com/kc_new/store_detail.html?s=productSKU > > Is there a way to pass the productSKU to the new url? How about: RewriteCond %{HTTP_HOST} ^store.knifecenter.com$ [NC] RewriteCond %{QUERY_STRING} ^(.*)$ [NC] RewriteRule ^pgi-ProductSpec$ http://www.knifecenter.com/kc_new/store_detail.html?s=%1 (I haven't checked this.) In human language: the first line checks if the host is store.knifecenter.com, the second line puts the full query_string (the bit after the ? in the URL) into %1 and the second line does the actual rewriting. Martijn. --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org " from the digest: users-digest-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org