httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From (Sean Conner)
Subject [users@httpd] Odd interaction between mod-rewrite and mod-cgi
Date Sat, 09 Jul 2005 07:26:09 GMT

  I have a few CGI scripts, written in C (legacy stuff that I don't wish to
rewrite if possible) that work fine under Apache 1.3.  When moved to Apache
2.0.54 (latest version) they still work, but Apache seems to include
additional output at the bottom of the page:

	HTTP/1.1 200 OK Date: Sat, 09 Jul 2005 07:14:04 GMT Server:
	Apache/2.0.54 (Unix) DAV/2 Content-Length: 0 Connection: close
	Content-Type: text/plain

  Now, the setup.  It's a stock install of Apache 2.0.54 from source, using
the pre-fork MPM with all the modules installed as DSOs.  CGIs with an
extention of .cgi can be run from anywhere, and there's one virtual host

	  DocumentRoot  /home/spc/blog/htdocs
	  CustomLog     logs/ combined
	  <Directory /home/spc/blog/htdocs>
	    AllowOverride       All
	    Options             All

  The scripts (there are two, one's just purely for testing) that are
non-parsed headers CGIs, and indeed, if you go to them directly:

  you can see they work fine.  Now, I also have a .htacess file with some
mod-rewrite rules:

	RewriteEngine on
	RewriteBase   /

	RewriteRule   ^([0-9][0-9])(.*) nph-blog.cgi/$1$2 [L]
	RewriteRule   ^(test)(.*)       nph-raw.cgi/$1$2  [L]
	RewriteRule   ^(foo)(.*)        nph-raw.cgi?$1$2  [L]

  Hit the following URLs:

  And you'll see the spurious output at the bottom of the pages (at least in
Firefox and Lynx---the output appears after the </HTML> tag so some browsers
may ignore it, but it's there).  I did some searches and could not find any
bugs close to this behavior in Apache 2.0 (this all works fine under Apache
1.3, also the main page at is a static page so
that's why there's no spurious output there).  And nothing appears in the
error log.

  Have I actually found a big in Apache 2.0.54?



The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message