Jump to content


Photo

How to stop files from being listed


  • Please log in to reply
3 replies to this topic

#1 JRS

JRS
  • Members
  • PipPipPip
  • Advanced Member
  • 45 posts

Posted 25 September 2006 - 04:25 PM

Hello,

Is there a way to stop all the files from being listed if an invalid file name is entered?

For example I have
www.mysite.com/scripts/main.php

If I type in : www/mysite.com/scripts/

Then all the files in that directory are displayed to end user.

Is there a way I can prevent all the files from being displayed to the user?

Thanks in advance
JRS

#2 alpine

alpine
  • Members
  • PipPipPip
  • Advanced Member
  • 756 posts
  • LocationNorway

Posted 25 September 2006 - 04:27 PM

easiest way: put an empty index.html in the directory

#3 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 25 September 2006 - 04:42 PM

Or add a .htaccess file in to the scripts folder and add the followingto the htaccess file:
Options -Indexes
When you go to the scripts folder the user will get the 403 Forbidden error message


#4 JRS

JRS
  • Members
  • PipPipPip
  • Advanced Member
  • 45 posts

Posted 26 September 2006 - 01:36 AM

alpine, wildteen88

Thank you very much for your suggestions. It was a great help.
This one is solved!
JRS





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users