setting permissions

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mcog_esteban
Forum Contributor
Posts: 127
Joined: Tue Dec 30, 2003 3:28 pm

setting permissions

Post by mcog_esteban »

hi all.
when building my homepage and created some dir's(images,scripts,etc) and some *.inc files.
my question is :how can i prevent others from browsing this dir's(http://my.homepage/images) and protect the *.inc files?
should i use .htacess files -how?- or there's some other tricks?
thanks.
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

Put an index.html/php in your images directory, then that directory can't be 'browsed'. Though directories without an index file shouldn't be browsable unless you have an 'Options Indexes' in your httpd.conf

You could just rename your .inc files to .php or have .inc files parsed as php by adding .inc to your AddType line in http.conf, something like..
AddType application/x-httpd-php .php .html .inc
Post Reply