--- src/mod_fastcgi.c.orig Tue Jul 17 22:02:33 2007 +++ src/mod_fastcgi.c Thu Aug 16 16:53:22 2007 @@ -3536,13 +3536,22 @@ static handler_t fcgi_check_extension(server *srv, con * * SCRIPT_NAME = /fcgi-bin/foo * PATH_INFO = /bar + * + * if prefix = / + * + * /foo/bar + * + * SCRIPT_NAME = + * PATH_INFO = /foo/bar * */ /* the rewrite is only done for /prefix/? matches */ if (extension->key->ptr[0] == '/' && - con->uri.path->used > extension->key->used && - NULL != (pathinfo = strchr(con->uri.path->ptr + extension->key->used - 1, '/'))) { + /* Special case for "/" */ + ((extension->key->ptr[1] == '\0' && (pathinfo = con->uri.path->ptr)) + || (con->uri.path->used > extension->key->used && + NULL != (pathinfo = strchr(con->uri.path->ptr + extension->key->used - 1, '/'))))) { /* rewrite uri.path and pathinfo */ buffer_copy_string(con->request.pathinfo, pathinfo);