Forum Moderators: phranque
I have a specific directory inside of public_html called restricted. In restricted, I have placed a zipped file containing some marketing materials for my company (there are no other files here).
The directory, restricted, is password protected using the cPanel (which has just created the .htaccess file and passwd file for me). There is only one username currently. This is the only directory that is password protected.
When you visit the site, head to the "Support" area, and the click on the link to "Logos & Identity", you are taken to a page in public_html which has information about obtaining the username and password for restricted.
On the logo page, there is a link to download the zipped file that has been placed inside of the restricted directory. When you click on the link, it prompts the user for a username and password.
If you have the correct username and password, you are given the dialog box to download the zipped file. Works perfectly.
If you do not, however, have the username and password, the alert box will NOT go away. You cannot click cancel, you cannot close it, you are not taken to a "403 Forbidden" or any other error page. Nothing. It is annoying and the alert box will not go away. You actually have to force quit your browser.
This is a huge problem and I cannot for the life of me figure out how to solve it.
This is the contents of my .htaccess file for the restricted directory:
AuthType Basic
AuthName "Waterway Logo Download"
AuthUserFile "/home/waterboy/.htpasswds/public_html/restricted/passwd"
require valid-user
Options All -Indexes
The URL for the website is:
<snip>
(menu "Support" --> "Logo & Identity" --> click on the link to download)
Any help would be greatly appreciated! Thank you!
[edited by: jdMorgan at 10:09 pm (utc) on Jan. 21, 2008]
[edit reason] No URLs, please. See TOS. [/edit]
Yes, we do have custom error pages.
Right now, they are located in public_html. So, the 401 error is:
/home/waterboy/public_html/401.shtml
or
[ourdomainhere.com...]
(edited out the domain name, since I saw you snipped it before :))
(oops, sorry about that-- typo above that I've fixed.)
[edited by: aHart at 10:15 pm (utc) on Jan. 21, 2008]
As far as I can tell, right now, there is no mention of ErrorDocument in any .htaccess file (obviously running into a problem for the restricted directory).
Am I right in thinking I will need to add:
ErrorDocument 401 ../401.shtml
to the .htaccess file inside of restricted?
I suppose you could try it as a "proof of concept" like this, with a server-rooted local URL-path (required):
ErrorDocument 401 /401.shtml
Jim