Web Creation Question
I'm in the process of creating a website, but I was wondering how do you make it so people can't access a particular folder?
Basically....
http://mysite.blah.com/content/newupdate.htm (not a real link) - The file "newupdate.htm" is kept in the directory ./content/
If someone were to just go to the directory (http://mysite.blah.com/content/) they'd see the following --
---------------------------------------------------------------------------------
Index of /content/
Name | Last Modified | Size | Description
Parent Directory
newupdate.htm | 28-Jan-2004 06:11 | 1k
---------------------------------------------------------------------------------
How do I make it so that they get a error saying they don't have access to the contents of that page? Something like this - http://www.stratics.com/content/
This is probably a newb question, but any help would be appreciated. Thanks.
- Oliver
Basically....
http://mysite.blah.com/content/newupdate.htm (not a real link) - The file "newupdate.htm" is kept in the directory ./content/
If someone were to just go to the directory (http://mysite.blah.com/content/) they'd see the following --
---------------------------------------------------------------------------------
Index of /content/
Name | Last Modified | Size | Description
Parent Directory
newupdate.htm | 28-Jan-2004 06:11 | 1k
---------------------------------------------------------------------------------
How do I make it so that they get a error saying they don't have access to the contents of that page? Something like this - http://www.stratics.com/content/
This is probably a newb question, but any help would be appreciated. Thanks.
- Oliver
Do a search for information on creating a .htaccess and a .htpasswd file on your webserver.
I don't remember how to do it off the top of my head, but I believe the password has to be encrypted before it's put into the password file.
I don't remember how to do it off the top of my head, but I believe the password has to be encrypted before it's put into the password file.
You can do this with a webscript depending on what technology you're using.
You can do this pretty easily in IIS, or if you're not hosting this, there's usually a control panel that allows you to set specific permissions on files/folders.
You can do this pretty easily in IIS, or if you're not hosting this, there's usually a control panel that allows you to set specific permissions on files/folders.
Pretty easy.
For MS-based servers, make the default file "default.html" or whatever extension you are using.
For UNIX-based server, make the default file "index.html" or whatever extention your are using.
This will make it so that your directories are not browsable, but if a user knows the exact name of the another file in that directory, they would have to explicitly type in the file name in order to access it. The default files make it so that no one can casually browse your directory files from a standard HTTP protocol.
For MS-based servers, make the default file "default.html" or whatever extension you are using.
For UNIX-based server, make the default file "index.html" or whatever extention your are using.
This will make it so that your directories are not browsable, but if a user knows the exact name of the another file in that directory, they would have to explicitly type in the file name in order to access it. The default files make it so that no one can casually browse your directory files from a standard HTTP protocol.
Thread
Thread Starter
Forum
Replies
Last Post



