Jump to content

Recommended Posts

Posted

hi there

i'm trying to hide certain files from getting viewed from the index. i've some file types that are to be read by the server but i don't want them to be seen from the index..

users view the index through a php.

how can i accomplish this?

thanks

  • 1 month later...

Posted

If you are using a computer using Apache, there are two files to use .htaccess and .htpasswd ->

.htaccess

AuthUserFile "path to .htaccess and .htpasswd"/.htpasswd

AuthName PasswordArea

AuthType Basic

require valid-user

.htpasswd

username:password

In the case that you are not running the server, put these two files in the directory(s) you want protected. You have to change the first line in the .htacces to conform to your directory in each instance. The .htpasswd part you need to have just a normal username, but the password needs to be in the cool *nix style. Using something like this web page http://spectrum.troyst.edu/password/ . When working properly, the person should recieve a prompt to have a login and password. There are even changes that you can make to protect an individual file if wanted. Help can be found at the Apache website.

Posted

Maybe he got the solution to that long ago.

Anyways, having this in your .htaccess might do what you need?

# //Preventing Directory Listing any filename of the specified extension
IndexIgnore *.gif *.jpg

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...