please help!

Discussion in 'PHP' started by PinoyIto, Apr 6, 2007.

  1. #1
    I am not sure if this is the correct place to post this one..

    Will you please help me to mod rewrite my site images, I want that when someone directly access the image in their browser it will redirect to a php file... but if the site it self request the images it will not redirected...

    Here is the example url
    http://cars.bayaw.com/pictures/2005FerrariEnzo1.jpg he or she will be

    I want that URL will be redirected to this url
    http://cars.bayaw.com/zoom/2005FerrariEnzo1.jpg/2005 Ferrari Enzo/
    when someone directly requesting the first url from their browser or any location except the site it self.

    Thanks in advance...
     
    PinoyIto, Apr 6, 2007 IP
  2. Rub3X

    Rub3X Well-Known Member

    Messages:
    1,902
    Likes Received:
    75
    Best Answers:
    0
    Trophy Points:
    135
    #2
    You'll prolly get an answer here, but the Apache section is suited for apache module questions ;)
     
    Rub3X, Apr 6, 2007 IP
  3. degy

    degy Peon

    Messages:
    145
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    try
    Options +FollowSymlinks
    RewriteEngine on
    RewriteRule ^(.+).jpg wrror.php [nc]

    than copy it for every file type you want
    but i'm not sure if this works post if not and i'll take a look
     
    degy, Apr 7, 2007 IP
  4. PinoyIto

    PinoyIto Notable Member

    Messages:
    5,863
    Likes Received:
    170
    Best Answers:
    0
    Trophy Points:
    260
    #4
    It redirecting now to the php file but the problem now is that the pictures are not showing anymore...
     
    PinoyIto, Apr 7, 2007 IP
  5. degy

    degy Peon

    Messages:
    145
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    oh yeah lol sorry that was just the code i used for normal redirect

    here you go

    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?yoursite.com(/)?.*$ [NC]
    RewriteRule .*\.(gif)$ /img.php [R,NC]
     
    degy, Apr 8, 2007 IP