Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Dec 2002
    Location
    Seattle, WA
    Posts
    116
    Thanks
    1
    Thanked 0 Times in 0 Posts

    regarding chmod and directory lists

    I want to set the permissions on my images directory so that my web pages can still load images from the directory. However, I don't want a user to be able to browse to my images directory and see a directory listing of all the files.

    Is this possible? If so I can't seem to find the correct combination of numbers that make it do that. Whenever I change the permissions on the directory to give me a 403 error rather than a directory listing, my page also can't load the images anymore.

    The page that would be loading the images is a PHP file...would that make a difference? Thanks.

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Since you seem to be falling into the nether without a reply. I think you're looking at the wrong tool for the job. I don't know Apache or I could be a lot more specific but I think you should be looking at the .htaccess for that directory instead. I believe a rule set up in there is the key.

    Try this link, it should get you the specifics you need: http://www.javascriptkit.com/howto/htaccess6.shtml
    Check out the Forum Search. It's the short path to getting great results from this forum.

  • #3
    Mega-ultimate member
    Join Date
    Jun 2002
    Location
    Winona, MN - The land of 10,000 lakes
    Posts
    1,855
    Thanks
    1
    Thanked 45 Times in 42 Posts
    Alternatively, you could place an empty index.html file in there. Usually a webserver (especially Apache) is set up to first look for an index.html (or similar file) and if none is found, display the contents of the directory. But Roy is correct, you can also set this up with .htaccess.

  • #4
    Regular Coder
    Join Date
    Dec 2002
    Location
    Seattle, WA
    Posts
    116
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I had considered making my own index file with a redirect in t or something...just wanted to know if there was a way to do it with chmod because I swear it was like that when I started on my current server and I did a chmod to make it the way it currently is.

    I think I'm going to spend some time learning about .htaccess files because they seem pretty interesting. Thanks.


  •  

    Posting Permissions

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