Just did some testing. The following should work

<Location /test>
          RewriteEngine       On
          RewriteCond        %{HTTP_REFERRER}  !$2$3
          RewriteRule         ^/(.*)/([^/]*\.)(html|htm|php)$ 
/test-redir.php?page=/test/$2$3 [R,L]
</Location>

If referer does not contain $2/$3, the RewriteCond will match.

> 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.

> Only other status codes than 301, 302, 303 will be forced immediately (eg. 
> R=404, since apache 2.1).

Correct. I tested against 2.0.54. From memory P was rewritten into proxy:URL 
and was not forced immediately, but I thought R was. Tests show it is not.

-ascs

-----Original Message-----
From: Robert Ionescu [mailto:[EMAIL PROTECTED] 
Sent: Monday, May 29, 2006 7:36 PM
To: users@httpd.apache.org
Subject: Re: [EMAIL PROTECTED] mod_rewrite

Axel-Stéphane SMORGRAV wrote:
> The L is not necessary since the redirect is immediate.

Rules below would be tested, but they wouldn't match unless the pattern starts 
with scheme + :// + url-path.

Only other status codes than 301, 302, 303 will be forced immediately (eg. 
R=404, since apache 2.1).

--
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: [EMAIL PROTECTED]
   "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to