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|...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |
|
|||
|
"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 |
|
|||
|
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 |