Forum Moderators: phranque

Message Too Old, No Replies

401 ErrorDocument when whole site password protected?

         

Xavier

8:15 am on Dec 18, 2004 (gmt 0)



On my website I only want my friends to climb aboard the boat of supremeness. But I want people that fail to give a good user/pass to be sentenced to: /errors/hell.html! But that doesn't work because my root folder (/) is password protected! And thus it would be forbidden for them to go to html hell! I've tried doing this:

--------------------

AuthUserFile C:/blah/.htpasswd
AuthGroupFile C:/dev/null
AuthName "Whoa Buddy! Email example@msn.com if you want to pass!"
AuthType Basic

require nobody


--------------------

Thus not requiring anyone to enter the /errors/ folder. But that doesn't work :(. Does have an idea on how to solve this? Thank you for your time! Merry Christmas!

[edited by: jdMorgan at 2:26 am (utc) on Dec. 19, 2004]
[edit reason] Removed specifics per TOS [/edit]

Xavier

8:36 am on Dec 18, 2004 (gmt 0)



I just figured it out!

My .htaccess that password protects my site:
-----------------------------------

AuthUserFile /var/.htpasswd
AuthGroupFile /dev/null
AuthName "Whoa Buddy!"
AuthType Basic

ErrorDocument 401 /errors/auth.php
<Limit POST GET>
require user CGod
</Limit>[code]
-----------------------------------

The .htaccess where the /errors folder is:
-----------------------------------
[code]AuthUserFile /var/.htpasswd
AuthGroupFile /dev/null
AuthName "Whoa Buddy!"
AuthType Basic

<LIMIT POST>
require user CGod
</LIMIT>


-----------------------------------

You see what I did was that when I <LIMIT GET>, I'm actually blocking the page all of the time. So I just use <LIMIT POST> so that the page will appear! I'm so smart :)