Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Results 1 to 8 of 8

This is a discussion on Help Me Protect My Image Folder Plz in the Open Discussion & Chit-chat forum
Greetings once again. Just need help in protecting my image folder. How do I go about doing that, in other words, anybody can now go ...

  1. #1
    JPC Senior Member Ms_Lamborghini's Avatar
    Join Date
    Mar 2006
    Posts
    78

    Angry Help Me Protect My Image Folder Plz

    Greetings once again.

    Just need help in protecting my image folder.
    How do I go about doing that, in other words, anybody can now go to my server and view all my images in my image folder. I want that to be un-accessible to the general public.
    They can easily get my image path by right clicking on it and BAM!

    Is there a way from preventing surfers from going into my image folder?

    Thank You!
    MS L

  2. #2
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    6,003
    In an .htaccess file in the images directory add

    Code:
    Options -Indexes
    That will trigger a 403 (forbidden) error if someone tries to browse that path without a specific filename.

    You can also put an empty index.html file in the directory and get a similar effect.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

  3. #3
    JPC Addict Robertjp's Avatar
    Join Date
    Jun 2006
    Posts
    124
    Put a .htaccess file in your image folder and place below line in it to disable indexing for that folder , this way no one can view the images in your folder through browser :

    Options -Indexes

    Edit : Jason was quick

  4. #4
    JPC Senior Member Ms_Lamborghini's Avatar
    Join Date
    Mar 2006
    Posts
    78
    EXCELLENT!!
    Both are great suggestions. I'm on it right now

    THANKS to both of you,
    Love this place!!

    MS L

  5. #5
    Ron
    Ron is offline
    Loyal Client
    Join Date
    Aug 2002
    Posts
    7,304
    In an .htaccess file in the images directory add

    Code:
    Options -Indexes
    That will trigger a 403 (forbidden) error if someone tries to browse that path without a specific filename.

    You can also put an empty index.html file in the directory and get a similar effect.

    --Jason Ron
    Good luck

  6. #6
    I didn't do it! Daniel_DBS's Avatar
    Join Date
    Aug 2007
    Location
    Mars
    Posts
    1,204
    Hmmm Ron... NO COMMENT
    -Daniel

    If the automobile had followed the same development cycle as the computer, a Rolls-Royce today would cost $100, get a million miles to the gallon, and explode once every few weeks.

    My scripts never have bugs. They just develop random features.

  7. #7
    Old Hillbilly Connie's Avatar
    Join Date
    Sep 2001
    Location
    Hills of Missouri
    Posts
    2,646
    I not sure Options -Indexes will accomplish what you want. If someone looks at your spruce code they will find the exact path to the image they want to steal or link to. With the exact pat to a particular image they could steal or hot link to the image.

    To cover all bases I would suggest adding this to your .htaccess file too.

    ####prevents hotlinking
    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?domain.com.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^https://secure.domain.com/.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?69.xx.181.xxx(/)?.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?images.ask.com.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?images.google.com.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?images.google.ca.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?domain.com.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?69.73.187.209(/)?.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?images.search.yahoo.com.*$ [NC]
    RewriteRule \.(gif|jpg|jpeg|png|bmp|tif|zip)$ - [F,NC]

    The above rule will allow some site to copy (or link to) images, and for those not listed they will get a 403 error page.

    Frankly your question was a little vague IMO. I think you need to do both.

    Forum Moderators - Jag Staff

    Spam Whackers Blog - Dedicated to fighting Spam and providing General SEO Tips
    Organize your Kitchen or purchase Kitchen Accessories at Condells
    Ihelpyou Forum - Dedicated to "Best Practices" SEO

  8. #8
    JPC Member
    Join Date
    Feb 2010
    Posts
    1
    PHP Folder Protection

    Create a index.php file put into the image or whatever folder you want to protect.

    It will redirect the surfer to your main page.

    Example:
    <? header("Location: http://www.yoursite.com"); ?>

    Hope it's helps.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •