RewriteEngine on / RewriteCond / RewriteRule error

Discussion in 'Apache' started by gatordun, Aug 3, 2005.

  1. #1
    Ok what is wrong with this rewrite code?

    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?website.com/.*$ [NC]
    RewriteRule \.(gif|jpg|png|jpeg|txt)$ - [F] [NC]

    Evertime i load it in htaccess i get a 403 forbidden error when trying to access the site thru frontpage.
    If i remove it, i can access the site with frontpage.
     
    gatordun, Aug 3, 2005 IP
  2. johnt

    johnt Peon

    Messages:
    178
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Check your logs to see exactly which request is producing the forbidden result code. Perhaps Frontpage is trying to download any image or something. Anyway, when you see which request is causing the forbidden you should be able to fine-tune your .htaccess accordingly
     
    johnt, Aug 4, 2005 IP
  3. gatordun

    gatordun Guest

    Messages:
    114
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    That's why it was removed.
    It should not cause an error.
    So why is it?
    Should be RR?
    REFERRER?
    Nope that did not work either.

    RewriteEngine on
    RewriteCond %{HTTP_REFERRER} !^$
    RewriteCond %{HTTP_REFERRER} !^http://(www\.)?website.com/.*$ [NC]
    RewriteRule \.(gif|jpg|png|jpeg|txt)$ - [F] [NC]
     
    gatordun, Aug 4, 2005 IP