RE: [users@httpd] mod_rewrite

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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@xxxxxxxxxxxxxx] 
Sent: Monday, May 29, 2006 10:32 PM
To: users@xxxxxxxxxxxxxxxx
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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux