Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

JonHimself

macrumors 68000
Original poster
Nov 3, 2004
1,553
5
Toronto, Ontario
I was hoping to get some help here. I have a website to show-off concert photos that I take and it's really basic... just the lighbox script to have each concert set pop-up in its own album.
I'm not concerned about people taking my pictures or using them for whatever but would rather control that myself (ie just send anyone who is interested a link to download them).
I've noticed that when I type in my url.com/images/ I am able to see all of the files and sub folders and browse right to the specific concert albums. I know that I've tried doing this on other web-sites to download some pictures but have been unable to. Does anyone know if it's possible to block access to those folders simply by typing in the URL?
 

edesignuk

Moderator emeritus
Mar 25, 2002
19,232
2
London, England
Create a file called ".htaccess" (without quotes!) and put this in it:

Options All -Indexes

May as well put it at the top of your directory structure, this way directory indexing will be disabled for all sub-folders.
 

edesignuk

Moderator emeritus
Mar 25, 2002
19,232
2
London, England
Yup, it's just a flat text file with no extension. Make sure it's CHMOD'd to 644 too on the server.

Be careful with TextEdit, it still might leave it as RichText or something.
 

JonHimself

macrumors 68000
Original poster
Nov 3, 2004
1,553
5
Toronto, Ontario
Yup, it's just a flat text file with no extension. Make sure it's CHMOD'd to 644 too on the server.

Be careful with TextEdit, it still might leave it as RichText or something.

Yeah, there's way to change that so that it strips the RTF (or something like that). I remember coming across it when I was reading about something else.

Also, when you say make sure it's CHMOD'd, could you explain a little more? I spent the last little while trying to understand what CHMOD was all about and what I might have to do to do what you've said but am lost. To put it in context, I use Dreamweaver, know HTML and after a year or two of not learning any web-related coding I've started to understand CSS... so I'm not exactly 'advanced'.
 

edesignuk

Moderator emeritus
Mar 25, 2002
19,232
2
London, England
Through your FTP client you should see an option to CHMOD. CHMOD is just setting permission for the file. 644 is what this file should be set to.
 

kAoTiX

macrumors 6502
Oct 14, 2008
487
0
Midlands, UK
Also if you add an index.html (.htm .php .asp) into the /images/ directory with nothing in it or redirect people will also not be able to list the images in the directory.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.