httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ruediger Pluem <rpl...@apache.org>
Subject Re: svn commit: r1042255 - in /httpd/httpd/trunk: CHANGES docs/manual/mod/mod_rewrite.xml modules/mappers/mod_rewrite.c
Date Sun, 05 Dec 2010 15:12:22 GMT


On 12/04/2010 11:33 PM, covener@apache.org wrote:
> Author: covener
> Date: Sat Dec  4 22:33:46 2010
> New Revision: 1042255
> 
> URL: http://svn.apache.org/viewvc?rev=1042255&view=rev
> Log:
> PR 39313: allow the user to configure which rules come first when RewriteRules
> are merged with RewriteOptions Inherit.
> 
> Submitted By: Jérôme Grandjanny <jerome.grandjanny cea.fr> 
> Reviewed By: covener
> 
> Modified:
>     httpd/httpd/trunk/CHANGES
>     httpd/httpd/trunk/docs/manual/mod/mod_rewrite.xml
>     httpd/httpd/trunk/modules/mappers/mod_rewrite.c
> 
> Modified: httpd/httpd/trunk/CHANGES

> Modified: httpd/httpd/trunk/modules/mappers/mod_rewrite.c
> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/mappers/mod_rewrite.c?rev=1042255&r1=1042254&r2=1042255&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/modules/mappers/mod_rewrite.c (original)
> +++ httpd/httpd/trunk/modules/mappers/mod_rewrite.c Sat Dec  4 22:33:46 2010
> @@ -187,6 +187,7 @@ static const char* really_last_key = "re
>  
>  #define OPTION_NONE                 1<<0
>  #define OPTION_INHERIT              1<<1
> +#define OPTION_INHERIT_BEFORE       1<<2
>  
>  #ifndef RAND_MAX
>  #define RAND_MAX 32767
> @@ -2745,6 +2746,18 @@ static void *config_server_merge(apr_poo
>          a->rewriterules    = apr_array_append(p, overrides->rewriterules,
>                                                base->rewriterules);
>      }
> +    else if (a->options & OPTION_INHERIT_BEFORE) {
> +        /*
> +         *  local directives override
> +         *  and anything else is inherited (preserving order)
> +         */
> +        a->rewritemaps     = apr_hash_overlay(p, base->rewritemaps,
> +                                              overrides->rewritemaps);
> +        a->rewriteconds    = apr_array_append(p, base->rewriteconds,
> +                                              overrides->rewriteconds);
> +        a->rewriterules    = apr_array_append(p, base->rewriterules, 
> +                                              overrides->rewriterules);
> +    }

This means that the local rules come after the global rules in the array.
Doesn't this mean that they get applied after the global rules?

Regards

Rüdiger


Mime
View raw message