Help - Search - Members - Calendar
Full Version: htaccess hide file types from index
MSFN Forums > Coding, Scripting and Servers > Web Development (HTML, Java, PHP, ASP, XML, etc.)

   
Google Internet Forums Unattended CD/DVD Guide
XtremeMaC
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
Pointer1
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.
prathapml
Maybe he got the solution to that long ago.
Anyways, having this in your .htaccess might do what you need?
CODE
# //Preventing Directory Listing any filename of the specified extension
IndexIgnore *.gif *.jpg
Google Internet Forums Unattended CD/DVD Guide
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.