Return-Path: X-Original-To: apmail-httpd-modules-dev-archive@minotaur.apache.org Delivered-To: apmail-httpd-modules-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B5A049146 for ; Mon, 4 Jun 2012 20:53:35 +0000 (UTC) Received: (qmail 18937 invoked by uid 500); 4 Jun 2012 20:53:35 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 18860 invoked by uid 500); 4 Jun 2012 20:53:34 -0000 Mailing-List: contact modules-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: modules-dev@httpd.apache.org Delivered-To: mailing list modules-dev@httpd.apache.org Received: (qmail 18851 invoked by uid 99); 4 Jun 2012 20:53:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Jun 2012 20:53:34 +0000 X-ASF-Spam-Status: No, hits=0.2 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of apocalypse17@gmx.de designates 213.165.64.23 as permitted sender) Received: from [213.165.64.23] (HELO mailout-de.gmx.net) (213.165.64.23) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 04 Jun 2012 20:53:28 +0000 Received: (qmail 4936 invoked by uid 0); 4 Jun 2012 20:53:06 -0000 Received: from 78.35.166.159 by www010.gmx.net with HTTP; Mon, 04 Jun 2012 22:53:06 +0200 (CEST) Content-Type: text/plain; charset="utf-8" Date: Mon, 04 Jun 2012 22:53:06 +0200 From: "Marc apocalypse17" Message-ID: <20120604205306.183060@gmx.net> MIME-Version: 1.0 Subject: Change Request-Header before mod_rewrite To: modules-dev@httpd.apache.org X-Authenticated: #2236243 X-Flags: 0001 X-Mailer: WWW-Mail 6100 (Global Message Exchange) X-Priority: 3 X-Provags-ID: V01U2FsdGVkX18aAyAtOaMabx73oQt6L5O1o8Jsq3CxqqklKZaUNH ASB50aSd54JOB3Pt11LD3YXsvayB6pvEdWCA== Content-Transfer-Encoding: 8bit X-GMX-UID: ZUW/b+YmeSEqUjJ8SXQh+YN+IGRvb4Cv X-Virus-Checked: Checked by ClamAV on apache.org Hi all, I just developed my first apache module following the tutorial on the apache website. The module is responsible for adding one header value to the active request which must be checked in a mod_rewrite ReWriteCondition. The problem is, that this value never reaches the mod_rewrite Rule. The Header just behaves the same as the original request. Does anyone know why? What am I doing wrong? My module looks like this: static int helloworld_handler(request_rec* r){ if (!r->main) { apr_table_setn(r->headers_in, "X-CUSTOM-HEADER", "1"); } return DECLINED; } static void register_hooks(apr_pool_t* pool){ ap_hook_handler(helloworld_handler, NULL, NULL, APR_HOOK_FIRST); } module AP_MODULE_DECLARE_DATA helloworld_module = { STANDARD20_MODULE_STUFF, NULL, NULL, NULL, NULL, example_directives, register_hooks }; The .htacces file looks like this: RewriteEngine on RewriteCond %{HTTP:X-CUSTOM-HEADER} 1 [NC] RewriteRule from.html to.html The Rewrite-Rule is never executes fine. It always show the content of from.html. Thank you in advance, Marc -- Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de