Return-Path: Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 91819 invoked by uid 500); 20 Apr 2003 12:38:43 -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: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 91799 invoked from network); 20 Apr 2003 12:38:42 -0000 Received: from public1-with2-3-cust60.bagu.broadband.ntl.com (HELO jenny) (213.106.178.60) by daedalus.apache.org with SMTP; 20 Apr 2003 12:38:42 -0000 Received: from glencros.demon.co.uk (localhost [127.0.0.1]) by jenny (8.12.9/8.12.4) with ESMTP id h3KCbg0T013036 for ; Sun, 20 Apr 2003 13:37:42 +0100 Message-ID: <3EA29496.4040102@glencros.demon.co.uk> Date: Sun, 20 Apr 2003 13:37:42 +0100 From: Nick Glencross User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030328 X-Accept-Language: en-us, en MIME-Version: 1.0 To: users@httpd.apache.org X-Enigmail-Version: 0.73.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Subject: [users@httpd] Strange rewrite behaviour on alternate hits? Hi, Although I've been using Apache for CGI scripting for a few years, I'm a newbie on mod_rewrite. What I was trying to do is make the web server effectively ignore the URL, and always run the same single CGI script. mod_rewrite seems the best way to do this (correct me if I'm wrong!). I'm using the version that comes with apache-2.0.44 on gentoo. I've added the following three Rewrite* commands to the section in commonapache2.conf. -------------- Options -All -Multiviews AllowOverride None RewriteEngine on RewriteCond %{REQUEST_URI} !/cgi-bin/hello$ RewriteRule .* /cgi-bin/hello? Order deny,allow Deny from all -------------- For now, the CGI script is simply: #!/usr/bin/perl use CGI qw/:standard/ ; print header () ; print start_html ('Hello') ; print "Hello from HTML!\n" ; print end_html ; and when you run it, you get Content-Type: text/html; charset=ISO-8859-1 Hello Hello from HTML! So far so good, so regardsless of what url you enter, you get: "Hello from HTML!" BUT... then on the next hit have to wait a while and get "0 HTTP/1.1 200 OK Date: Sun, 20 Apr 2003 12:30:35 GMT Server: Apache/2.0.44 (Gentoo/Linux) Keep-Alive: timeout=15, max=99 Connection: Keep-Alive Transfer-Encoding: chunked Content-Type: text/html; charset=ISO-8859-1 129 Hello from HTML! 0 0" I see the timeout=15, and indeed there is roughly a 15 second wait. Refresh, and things are ok. The problem seems to happen on alternate hits. Now, if I browse "http://localhost/cgi-bin/hello" directly, there is never a problem, so it really does look as though it is rewrite specific. Can anyone shed any light on why I'm experiencing this, and even better, provide a solution to what I'm trying to do. Thanks in advance, Nick Glencross --------------------------------------------------------------------- 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