Timwi (timwi) wrote in lj_userdoc,
Timwi
timwi
lj_userdoc

FAQ #73

This says that any images references from your domain are acceptable...
"references" should be "referenced".

RewriteRule .*\.(jpg|gif)$ - [F]
I would suggest to add "png" as well, since it's become a very common image file format on the web. Thus:
RewriteRule .*\.(jpg|gif|png)$ - [F]
(notice: This appears twice in the FAQ; once in the list of commands at the top, and once in their explanations at the bottom.) Additionally,
Finally, if all of the above conditions match, and the request ends in .jpg
or .gif, then deny it:
should then be extended to
Finally, if all of the above conditions match, and the request ends in .jpg, .gif or .png, then deny it:


I'm finding it a bit confusing that for the first half of the lines, their explanation comes after the quoted line, while for the second half, the explanation is in front. Perhaps those explanations should be moved underneath. Thus:
Note that "\." means a literal ".". A period by itself means any character.

RewriteCond %{REQUEST_URI} !^/okay_image\.jpg
RewriteCond %{REQUEST_URI} !^/okay_image2\.gif
RewriteCond %{REQUEST_URI} !^/another/okay_image3\.jpg
RewriteCond %{REQUEST_URI} !^/final/okay_image\.gif

These rules make sure all of your images that are okay to share don't get denied.

RewriteRule .*\.(jpg|gif|png)$ - [F]

This last line says that, if all of the above conditions match, and the request ends in .jpg, .gif or .png, then it should be denied.

That's it!
Subscribe
  • Post a new comment

    Error

    Comments allowed for members only

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 2 comments