httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Axel-St├ęphane SMORGRAV <Axel-Stephane.SMORG...@europe.adp.com>
Subject RE: [users@httpd] mod_rewrite
Date Tue, 30 May 2006 06:07:04 GMT
> Without the L-flag, and after /a has been substituted with /b, the second rule would be
tested not against /b but against http://[host]/b, so the result is not /c. 

This is where my misconception about immediate redirection with the R flag comes from. Should
look at the code some more.

> RewriteRule /b /c

But here the pattern would also match /a/b/d which was not necessarily the intention.

Back to 

RewriteCond %{HTTP_REFERRER}<>$1 !(/test/.+)<>\1$

Could you elaborate a little about the syntax ? I have never seen anything like this in the
mod_rewrite manual page nor in the URL Rewriting Guide... but it obviously works as far as
I can tell from having given it a go. \1 is obviously a back-reference, but <> ?

-ascs


-----Original Message-----
From: Robert Ionescu [mailto:robsiegen@googlemail.com] 
Sent: Monday, May 29, 2006 10:32 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] mod_rewrite

Axel-St├ęphane SMORGRAV wrote:
>> Rules below would be tested, but they wouldn't match unless the pattern starts with
scheme + :// + url-path.
> 
> unless the RewriteCond pattern starts with /. The above matches just fine.

I meant this hypothetical case

RewriteRule ^/a /b [R]
RewriteRule ^/b /c

Without the L-flag, and after /a has been substituted with /b, the second rule would be tested
not against /b but against http://[host]/b, so the result is not /c.
So removing the L flag in that case won't change r->filename to /c

while using

RewriteRule ^/a /b [R]
RewriteRule /b /c

would now end up in /c and no external redirection takes place at all.

--
Robert

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message