You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Miguel Figueiredo <mi...@gmail.com> on 2013/08/28 17:02:02 UTC

[users@httpd] Order of precedence in RewriteRule / RewriteCond statements

People,

I have a doubt, maybe is silly but I didn't find anywhere one answer for it.

I have one set of rules in my Apache configuration and recently I was asked
to make one rule more generic for all the cases where the previous rules
don't apply.

So my doubt is:

If I put my rules like

<rule1>
<rule2>
<rule3>
<rule4>
.
.
.
<rule generic>

Will the rewrite module respect the order of the rules in the config file
and execute the rules in order?

Sorry if I did some mistakes in my english because it's not my first
language. I hope I did some sense,
not a pile of garbage... :)

Any help is welcome, even indicate my question is silly and stupid,
answered anywhere else. Please
be kind and indicate to me where I can find the answer. I'm a little
desperate by now... :)

Best regards,

-- 
Miguel Figueiredo

Re: [users@httpd] Order of precedence in RewriteRule / RewriteCond statements

Posted by Eric Covener <co...@gmail.com>.
On Wed, Aug 28, 2013 at 11:02 AM, Miguel Figueiredo
<mi...@gmail.com> wrote:
> People,
>
> I have a doubt, maybe is silly but I didn't find anywhere one answer for it.
>
> I have one set of rules in my Apache configuration and recently I was asked
> to make one rule more generic for all the cases where the previous rules
> don't apply.
>

The manual says:

Rewrite rules are applied to the results of previous rewrite rules, in
the order in which they are defined in the config file. The URL-path
or file-system path (see "What is matched?", above) is completely
replaced by the Substitution and the rewriting process continues until
all rules have been applied, or it is explicitly terminated by an L
flag, or other flag which implies immediate termination, such as END
or F.


-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org