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 0DB4B9F9C for ; Sun, 25 Sep 2011 02:34:29 +0000 (UTC) Received: (qmail 1059 invoked by uid 500); 25 Sep 2011 02:34:26 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 916 invoked by uid 500); 25 Sep 2011 02:34:26 -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 904 invoked by uid 99); 25 Sep 2011 02:34:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 Sep 2011 02:34:25 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [66.111.4.26] (HELO out2.smtp.messagingengine.com) (66.111.4.26) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 Sep 2011 02:34:18 +0000 Received: from compute6.internal (compute6.nyi.mail.srv.osa [10.202.2.46]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 0486920AB0; Sat, 24 Sep 2011 22:33:58 -0400 (EDT) Received: from frontend2.nyi.mail.srv.osa ([10.202.2.161]) by compute6.internal (MEProxy); Sat, 24 Sep 2011 22:33:58 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:date:from:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; s=smtpout; bh=cxWgKLsWy3gcUGyvdemOVd 4Vm2Y=; b=uiBN6t1ozWL0T+kjWneSMBWGhFpjCcus4oAclQaA+MJHultXN509p4 Z2SkIXSv3Sghgdk+2CFpYBzFuIvBFkoD+YtCiiuBYw8462X1wyWxr2L2IvDBgY7J tDP0OyVVDyqMEYT5HhGsXh8wGF7uaGyVgEkAUOAww1tqmeVKPTNwY= X-Sasl-enc: wOOUUL9x5Ld0+9LTgJCim4d71CHuAZ5GXFzaGCXNyPyg 1316918037 Received: from hitomi.local (unknown [198.111.179.55]) by mail.messagingengine.com (Postfix) with ESMTPSA id B6BB1980563; Sat, 24 Sep 2011 22:33:57 -0400 (EDT) Message-ID: <4E7E9315.8000907@catseye.org> Date: Sat, 24 Sep 2011 22:33:57 -0400 From: Mark Montague User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:5.0) Gecko/20110630 Thunderbird/5.0 MIME-Version: 1.0 To: Suneet Shah CC: users@httpd.apache.org References: <4E7E3CA4.10909@catseye.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Subject: Re: [users@httpd] Mod-ReWrite On September 24, 2011 22:23 , Suneet Shah wrote: > I made the change that you described below. Now the tkn header is > coming in as null. Have I made an error in assigning the tkn to var1? > > URL -> http://localhost/test_rpc/header.jsp?tkn=abc > Header value -> tkn: (null) > > RewriteCond %{QUERY_STRING} tkn=(.*) > RewriteRule ^/test_rpc/$ [E=var1:%1] > RequestHeader append tkn %{var1}e No, the problem is that the rewrite rule you have above tests for a path component that exactly matches /test_rpc/ with nothing before it and nothing after it. The URL you are testing with has a path component of /test_rpc/header.jsp -- so this does not match, the rewrite rule does not get invoked, and the 'var1' environment variable does not get set. To get a rewrite rule that tests for the correct thing, see https://httpd.apache.org/docs/2.2/rewrite/ in particular the "Introduction to regular expressions and mod_rewrite" section. Also, you appear to be missing the second argument of the rewrite rule. If you don't want to perform a substitution, then the substitution argument (the argument after the pattern argument and before the flags argument) needs to be a single dash ("-" without the quotes). -- Mark Montague mark@catseye.org --------------------------------------------------------------------- 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