htaccess mod_rewrite

Discussion in 'HTML & Website Design' started by bigpapa, Jan 14, 2008.

  1. #1
    I have a small script setup to insert watermarks on images in a directory. Instead of viewing images/boy.jpg, my .htaccess will automatically call images/watermark.php?img=boy.jpg, and the watermark is displayed. This is working correctly.

    However, I want to NOT rewrite watermark.php OR any images with "_thumb" in the filename. Here's what I've got:

    RewriteRule ^(watermark|watermark/watermark)\.php$|^.+\.(css|js)$ - [L] 
    RewriteRule ^(thumb|thumb/thumb)$|^.+\.(jpg|jpeg)$ - [L] 
    RewriteRule ^(.+) watermark.php?img=$1 [L]
    Code (markup):
    Something with the syntax in the second line is not correct. The watermark is still being displayed on the images with "_thumb" in the filename.

    Any assistance please????
     
    bigpapa, Jan 14, 2008 IP
  2. venam

    venam Peon

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    i cant find any error myself but i am not pro .
    Someone pro should help you soon.

    Maybe try to
    make a rewriting rule for that too: _thumb
     
    venam, Jan 15, 2008 IP
  3. bigpapa

    bigpapa Banned

    Messages:
    273
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    The rewrite rule for _thumb is the second line of code I posted above, but thats what is not working.
     
    bigpapa, Jan 15, 2008 IP
  4. VimF

    VimF Well-Known Member

    Messages:
    307
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    118
    #4
    How about this?

    RewriteRule ^(watermark|watermark/watermark)\.php$|^.+\.(css|js)$ - [L]
    RewriteCond %{REQUEST_FILENAME} !_thumb
    RewriteRule ^(.+) watermark.php?img=$1 [L]
     
    VimF, Jan 15, 2008 IP
  5. bigpapa

    bigpapa Banned

    Messages:
    273
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    That did it. I really appreciate it! +rep :)
     
    bigpapa, Jan 15, 2008 IP