Combining two rewrite rules - stuck :|

This is a discussion on Combining two rewrite rules - stuck :| within the Apache Web Server forums, part of the Web Server and Related Forums category; Hello I'm trying to combine: RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://poff\.sixbit\.org.*$ [NC] RewriteCond %{REQUEST_FILENAME} .*\.(jpg|...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-30-2003
poff
 
Posts: n/a
Default Combining two rewrite rules - stuck :|

Hello I'm trying to combine:

RewriteEngine on

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://poff\.sixbit\.org.*$ [NC]
RewriteCond %{REQUEST_FILENAME} .*\.(jpg|gif|png|jpeg)$
RewriteRule \.(jpg|gif|png|jpeg)$ http://poff.sixbit.org/thief.jpg [NC,L]

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://poff\.sixbit\.org.*$ [NC]
RewriteCond %{REQUEST_METHOD} POST
RewriteRule /* http://poff.sixbit.org [R]

Into one block (no repition):

RewriteEngine on

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://poff\.sixbit\.org.*$ [NC]
RewriteCond %{REQUEST_FILENAME} .*\.(jpg|gif|png|jpeg)$ [NC,OR]
RewriteCond ${REQUEST_METHOD} POST

RewriteRule \.(jpg|gif|png|jpeg)$ http://poff.sixbit.org/thief.jpg [NC,L]
RewriteRule /* http://poff.sixbit.org [R]

Why doesn't this work?

I couldn't see any examples of this in the docs (1.3.x)

Can anyone help?

Thanks,
--
poff@sixbit.org
SDF Public Access UNIX System - http://sdf.lonestar.org
  #2 (permalink)  
Old 07-31-2003
Terje
 
Posts: n/a
Default Re: Combining two rewrite rules - stuck :|

"poff" <poff@sixbit.org> wrote in message
news:slrnbienrs.q1t.poff@vinland.freeshell.org...
> Hello I'm trying to combine:
>
> RewriteEngine on
>
> RewriteCond %{HTTP_REFERER} !^$
> RewriteCond %{HTTP_REFERER} !^http://poff\.sixbit\.org.*$ [NC]
> RewriteCond %{REQUEST_FILENAME} .*\.(jpg|gif|png|jpeg)$
> RewriteRule \.(jpg|gif|png|jpeg)$ http://poff.sixbit.org/thief.jpg [NC,L]
>
> RewriteCond %{HTTP_REFERER} !^$
> RewriteCond %{HTTP_REFERER} !^http://poff\.sixbit\.org.*$ [NC]
> RewriteCond %{REQUEST_METHOD} POST
> RewriteRule /* http://poff.sixbit.org [R]
>
> Into one block (no repition):
>
> RewriteEngine on
>
> RewriteCond %{HTTP_REFERER} !^$
> RewriteCond %{HTTP_REFERER} !^http://poff\.sixbit\.org.*$ [NC]
> RewriteCond %{REQUEST_FILENAME} .*\.(jpg|gif|png|jpeg)$ [NC,OR]
> RewriteCond ${REQUEST_METHOD} POST
>
> RewriteRule \.(jpg|gif|png|jpeg)$ http://poff.sixbit.org/thief.jpg [NC,L]
> RewriteRule /* http://poff.sixbit.org [R]
>
> Why doesn't this work?


Well, mabe you have forgotten what [L] means ?
Try this:
RewriteRule \.(jpg|gif|png|jpeg)$ http://poff.sixbit.org/thief.jpg [NC]
RewriteRule /* http://poff.sixbit.org [R,L]


>
> I couldn't see any examples of this in the docs (1.3.x)
>
> Can anyone help?
>
> Thanks,
> --
> poff@sixbit.org
> SDF Public Access UNIX System - http://sdf.lonestar.org



  #3 (permalink)  
Old 07-31-2003
poff
 
Posts: n/a
Default Re: Combining two rewrite rules - stuck :|

Hi

>> RewriteRule \.(jpg|gif|png|jpeg)$ http://poff.sixbit.org/thief.jpg [NC,L]
>> RewriteRule /* http://poff.sixbit.org [R]
>>
>> Why doesn't this work?

>
> Well, mabe you have forgotten what [L] means ?
> Try this:
> RewriteRule \.(jpg|gif|png|jpeg)$ http://poff.sixbit.org/thief.jpg [NC]
> RewriteRule /* http://poff.sixbit.org [R,L]


That redirects valid requests to / :(

P


--
poff@sixbit.org
SDF Public Access UNIX System - http://sdf.lonestar.org
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:30 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0