|
|
Joined: Oct 2000
Posts: 2,665
Veteran
|
|
Veteran
Joined: Oct 2000
Posts: 2,665 |
wasn't sure on which forum to post this, so since this is server scripting matter I thought this forum would be best  anyway, I can't get htaccess to deny directory listing. Would anyone have the correct code ? thanks Chuck
Do you believe in love at first sight, or should I walk by again?
|
|
|
|
|
Joined: Jan 1999
Posts: 568
Moderator / Fish
|
|
Moderator / Fish
Joined: Jan 1999
Posts: 568 |
Options none
or just drop a blank index.html file in there.
[ April 17, 2001 11:48 AM: Message edited by: Sally ]
|
|
|
|
|
Joined: Oct 2000
Posts: 2,665
Veteran
|
|
Veteran
Joined: Oct 2000
Posts: 2,665 |
tried that but then I get 500 errors on my scripts and can't access the files
Do you believe in love at first sight, or should I walk by again?
|
|
|
|
|
Joined: Jan 1999
Posts: 568
Moderator / Fish
|
|
Moderator / Fish
Joined: Jan 1999
Posts: 568 |
hmmm, not sure why it's doing that.
For now I suggest you just drop the empty index.html in there.
|
|
|
|
|
Joined: Oct 2000
Posts: 2,665
Veteran
|
|
Veteran
Joined: Oct 2000
Posts: 2,665 |
Do you believe in love at first sight, or should I walk by again?
|
|
|
|
|
Joined: Mar 2000
Posts: 615
Member
|
|
Member
Joined: Mar 2000
Posts: 615 |
a. I think you can do Options -Indexes
b. 500 ISE's can also mean an error in .htaccess
my guess is that because 'ExecCGI' is one of the 'options', the fact that you don't have that doesn't let you execute CGI scripts?
|
|
|
|
|
Joined: Mar 2001
Posts: 25
Junior Member
|
|
Junior Member
Joined: Mar 2001
Posts: 25 |
quote:</font><HR>Originally posted by JohnM:
my guess is that because 'ExecCGI' is one of the 'options', the fact that you don't have that doesn't let you execute CGI scripts?<HR></BLOCKQUOTE> Thats exactly it. Here is how you do it. :)
<BLOCKQUOTE><font size="1" face="Verdana, Helvetica, Arial">code:
|
|
|
|
|
Joined: Oct 2000
Posts: 2,665
Veteran
|
|
Veteran
Joined: Oct 2000
Posts: 2,665 |
thanks I'll give it a try 
Do you believe in love at first sight, or should I walk by again?
|
|
|
|
|
Joined: Feb 2001
Posts: 78
Member
|
|
Member
Joined: Feb 2001
Posts: 78 |
First, create the HTML page you want to use as your error message. Second, upload it to your web directory [/home/$user/$domain-www]. Third, go into your .htaccess file (or create one) and add lines which specify the substitution. Here are three examples of specifying error documents which will be called for a given error condition (note you can use relative or absolute addressing): ErrorDocument 401 http://domain.com/nopasswd.html ErrorDocument 403 /forbidden.html ErrorDocument 404 http://www.domain.com/nofile.html
|
|
|
|
|
Joined: Mar 2000
Posts: 615
Member
|
|
Member
Joined: Mar 2000
Posts: 615 |
a) he doesn't want to use custom error messages, but to deny directory listings  b) /home/$user/$domain-www is on Alabanza servers. not all servers use that directory structure.
|
|
|
|
|
Joined: Feb 2001
Posts: 78
Member
|
|
Member
Joined: Feb 2001
Posts: 78 |
sorry, copied and pasted the wrong one. Just change the /home/$user to whatever yours is but this is how mine works.
-----------------------
The directory you want protected must have a .htaccess file in it that looks like the following (do not put the comments in the actual .htaccess file [comments begin with #]):
AuthUserFile /home/$user/.passwd AuthGroupFile /home/$user/.group AuthName "Protected Space" AuthType Basic
require group $users #users, is the group of users that you give access to #require user $user #if there is only one user in the group, you can substitute this line; remove the #.
(Other possible groups are administrators, etc)
Groups and users are stored in the .group file, and passwords are stored in .passwd. The .htaccess file looks for these files in the /home/$user directory. Do not attempt to edit these manually! Use the Control Panel function 'Protect Directories' to edit these files for you. With this function you can select the directory to be protected, then add users and their passwords that will have access. -----------------------------------------
|
|
|
|
|
Joined: Oct 2000
Posts: 2,665
Veteran
|
|
Veteran
Joined: Oct 2000
Posts: 2,665 |
FDSA, I tried your code, it works well but I still have a problem, SSI is not parsed anymore, would you know which tag I need to add ? wnxwakko, thanks for the help but I am not trying to protect a directory 
Do you believe in love at first sight, or should I walk by again?
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 449
Joined: February 2008
|
|
|
Forums63
Topics37,583
Posts293,955
Members13,824
| |
Most Online151,614 Nov 14th, 2025
|
|
Currently Online 2338
Topics Created 0
Posts Made 0
Users Online 0
Birthdays 24
|
|
|
|