954,173 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

htaccess to hide directory listing!

Hello guys,

I and my project team at varsity finished up a website with a database back end. We developed it on a Windows system but now deploying to a Unix server. We used the Yellow duck framework. We've managed to work out compatibility issues as Unix is very sensitive (which is good in my view :-)).

There's one problem we don't know how to solve yet. Students can view our directory listings on the web and can also see the code for our template files but not the php ones, and we've spoken to the web admin and he said we should use .htaccess and this will be solved. I have done research but can't come around how to do this. Unfortunately am not Unix savvy yet but will get there.

Please any help will be appreciated.

Many thanks in advance.

Ike185.

ike185
Newbie Poster
10 posts since Aug 2006
Reputation Points: 10
Solved Threads: 0
 

A quick web search will bring up the answer you are looking for, the option is called Indexes in the Options within the htaccess file add Options -Indexes (if you already have some Options listed, add the -Indexes to the end.

Further reading: http://www.clockwatchers.com/htaccess_dir.html

Will Gresham
Master Poster
755 posts since May 2008
Reputation Points: 96
Solved Threads: 125
 

If you'll add an index file to the folder, the directory files wont be listed. Obviously this is a short term solution to the problem. The better, long term solution, was already made by Xan.

buddylee17
Practically a Master Poster
697 posts since Nov 2007
Reputation Points: 232
Solved Threads: 137
 

thanks a lot xan and buddylee17.

ike185
Newbie Poster
10 posts since Aug 2006
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You