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 Mon, 29 May 2006 17:55:46 GMT
 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:robsiegen@googlemail.com] 
Sent: Monday, May 29, 2006 7:36 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] 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: 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