Welcome to MobyThreads.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

Combining two rewrite rules - stuck :|

 
   Web Hosting and Web Master Forums (Home) -> Apache RSS
Next:  Premature end of script headers: index.shtml  
Author Message
poff

External


Since: Jul 30, 2003
Posts: 2



(Msg. 1) Posted: Wed Jul 30, 2003 9:02 am
Post subject: Combining two rewrite rules - stuck :|
Archived from groups: alt>apache>configuration (more info?)

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 DeleteThis @sixbit.org
SDF Public Access UNIX System - http://sdf.lonestar.org

 >> Stay informed about: Combining two rewrite rules - stuck :| 
Back to top
Login to vote
temol

External


Since: Jul 31, 2003
Posts: 1



(Msg. 2) Posted: Thu Jul 31, 2003 1:08 pm
Post subject: Re: Combining two rewrite rules - stuck :| [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"poff" <poff.DeleteThis@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)$ <a style='text-decoration: underline;' href="http://poff.sixbit.org/thief.jpg" target="_blank">http://poff.sixbit.org/thief.jpg</a> [NC,L]
 >
 > RewriteCond %{HTTP_REFERER} !^$
 > RewriteCond %{HTTP_REFERER} !^http://poff\.sixbit\.org.*$ [NC]
 > RewriteCond %{REQUEST_METHOD} POST
 > RewriteRule /* <a style='text-decoration: underline;' href="http://poff.sixbit.org" target="_blank">http://poff.sixbit.org</a> [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)$ <a style='text-decoration: underline;' href="http://poff.sixbit.org/thief.jpg" target="_blank">http://poff.sixbit.org/thief.jpg</a> [NC,L]
 > RewriteRule /* <a style='text-decoration: underline;' href="http://poff.sixbit.org" target="_blank">http://poff.sixbit.org</a> [R]
 >
 > Why doesn't this work?

Well, mabe you have forgotten what [L] means ?
Try this:
RewriteRule \.(jpg|gif|png|jpeg)$ <a style='text-decoration: underline;' href="http://poff.sixbit.org/thief.jpg" target="_blank">http://poff.sixbit.org/thief.jpg</a> [NC]
RewriteRule /* <a style='text-decoration: underline;' href="http://poff.sixbit.org" target="_blank">http://poff.sixbit.org</a> [R,L]


 >
 > I couldn't see any examples of this in the docs (1.3.x)
 >
 > Can anyone help?
 >
 > Thanks,
 > --
 > poff.DeleteThis@sixbit.org
<font color=purple> > SDF Public Access UNIX System - <a style='text-decoration: underline;' href="http://sdf.lonestar.org</font" target="_blank">http://sdf.lonestar.org</font</a>><!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: Combining two rewrite rules - stuck :| 
Back to top
Login to vote
poff

External


Since: Jul 30, 2003
Posts: 2



(Msg. 3) Posted: Fri Aug 01, 2003 1:41 am
Post subject: Re: Combining two rewrite rules - stuck :| [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi

  >> RewriteRule \.(jpg|gif|png|jpeg)$ <a style='text-decoration: underline;' href="http://poff.sixbit.org/thief.jpg" target="_blank">http://poff.sixbit.org/thief.jpg</a> [NC,L]
  >> RewriteRule /* <a style='text-decoration: underline;' href="http://poff.sixbit.org" target="_blank">http://poff.sixbit.org</a> [R]
  >>
  >> Why doesn't this work?
 >
 > Well, mabe you have forgotten what [L] means ?
 > Try this:
 > RewriteRule \.(jpg|gif|png|jpeg)$ <a style='text-decoration: underline;' href="http://poff.sixbit.org/thief.jpg" target="_blank">http://poff.sixbit.org/thief.jpg</a> [NC]
 > RewriteRule /* <a style='text-decoration: underline;' href="http://poff.sixbit.org" target="_blank">http://poff.sixbit.org</a> [R,L]

That redirects valid requests to / Sad

P


--
poff RemoveThis @sixbit.org
SDF Public Access UNIX System - <a style='text-decoration: underline;' href="http://sdf.lonestar.org" target="_blank">http://sdf.lonestar.org</a><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Combining two rewrite rules - stuck :| 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
ReWrite Rules - Hi, Currently my homepage is http://www.indigoclothing.com/index.shtml However I would now want my homeapge to be: http://www.indigoclothing.com/cgi-bin/page.cgi?d=1&page=homepage The dynamic page is different from the static one as the featured...

mod rewrite question - I'm hoping I can get an answer to one of the 4 questions I've posted to this group over the last couple of months, so here goes. I'm serving XHTML files as application/xhtml+xml as they should be. But IE doesn't like this. What I wanted to do was us...

Rewrite to another Port - Hi, can somebody tell me how to make a ReWrite Rule for changing port ? Example: User calls sub.domain.com and rewrite should go to sub.domain.com:82 ? Thanks for your help. Bye, Fabian

virtualhost/rewrite help needed - Hi I have a (probably simple) vh (and maybe rewrite?) problem - the rule is simple at least and should work IMO - it's strange to me why it doesn't. This is what i do: NameVirtualHost 217.160.75.67 ### ...several vh... <VirtualHost openspirit.d...

rewrite url to hide GET values - Hello, I would rewrite url to handle a problem I have with dynamic media files. I use a php script to retrieve media files (quicktime, real video ....) from non public directories. I access the file via media.php?m=dataxxx. It works but the..
   Web Hosting and Web Master Forums (Home) -> Apache All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]