httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sebastian Färber <faer...@gmail.com>
Subject Re: ap_internal_fast_redirect / mod_dir and mod_rewrite interaction
Date Fri, 16 Jul 2010 15:00:18 GMT
> "have to make sure no changes"?  That's an oxymoron, you are changing your
> product significantly.  You might look at mod_version if you want conditional
> behavior (you would need it installed for both 1.3 and 2.2, of course).  Alt,
> you can always add a -D AP22 or similar to your 2.2 startup scripts.

You're right, but nothing wrong with trying to minimize the necessary
changes? :-)
Thanks for the pointer to mod_version, I'll have a look.


>> I tried converting mod_dir.c from ap_internal_fast_redirect to just
>> ap_internal_redirect which solves
>> my problem but i'm not sure if this is the right fix?
>
> Such a fix won't be incorporated by httpd for 2.2 (or 2.0) since these are
> constant in terms of their expected behavior from subver to subver.
>
> You will probably be glad to hear we are dropping internal_fast from 2.4 due
> to the number of side effects it causes, esp in 3rd party modules.

I'm fine with patching this locally ... but after applying my patch
(see at the end of my mail)
i always get an error in my log from mod_autoindex - complaining that
"Options Indexes" isn't set.
I'm puzzled why mod_autoindex is even running, mod_dir took care of
the translation from "/" -> "/index.html".
Any ideas or pointers? Would be great!


-- Sebastian

--- /httpd-2.2.15/modules/mappers/mod_dir.c   2006-07-12
05:38:44.000000000 +0200
+++ modules/mappers/mod_dir.c   2010-07-16 16:55:15.000000000 +0200
@@ -195,7 +195,12 @@ static int fixup_dir(request_rec *r)
         if (rr->status == HTTP_OK
             && (   (rr->handler && !strcmp(rr->handler, "proxy-server"))
                 || rr->finfo.filetype == APR_REG)) {
-            ap_internal_fast_redirect(rr, r);
+            char *new_uri = ap_escape_uri(r->pool, rr->uri);
+            if (rr->args != NULL)
+               new_uri = apr_pstrcat(r->pool, new_uri, "?", rr->args, NULL);
+            else if (r->args != NULL)
+               new_uri = apr_pstrcat(r->pool, new_uri, "?", r->args, NULL);
+             ap_internal_redirect(new_uri, r);
             return OK;
         }

Mime
View raw message