Author |
Message |
Hypergluco
Junior WebHelper
![Junior WebHelper Junior WebHelper](images/rank_1.gif)
Joined: 04 May 2006
Posts: 6
Location: London
|
Posted:
Thu May 04, 2006 4:27 pm (18 years, 1 month ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
I'm a designer more than a developer so I'd really appreciate some help with this.
It seems a very straightforward problem. I use .htaccess to protect a section of a client's site, successfully, in conjunction with an .htpasswd file which sits outsite the public root. When login fails, I get the usual Apache 401 screen which looks like ****, so I've included an ErrorDocument redirect to my own error page (401.html), and the htaccess looks like this:
AuthUserFile /home/user/.htpasswd
AuthGroupFile /dev/null
AuthName "Students"
AuthType Basic
ErrorDocument 401 http://www.myclient.co.uk/401.html
<Limit GET POST PUT>
require valid-user
</Limit>
It doesn't work. It just goes to the Apache 401 page without redirecting.
Surely login failure redirection to a more attractive page than Apache's effort is common? Help me here - this makes sense to me so I don't understand why it won't work.
Thanks
James |
|
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by Hypergluco Find all posts by Hypergluco](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) ![Visit Poster's Website Visit Poster's Website](templates/4WebHelp2/images/lang_english/icon_www.gif) ![MSN Messenger MSN Messenger](templates/4WebHelp2/images/lang_english/icon_msnm.gif) |
![](images/spacer.gif) |
adam
Forum Moderator & Developer
![](images/rank_6.gif)
Joined: 26 Jul 2002
Posts: 704
Location: UK
|
Posted:
Fri May 05, 2006 8:01 am (18 years, 1 month ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
Have you tried "ErrorDocument /401.html" rather than using a full URL? |
________________________________ It's turtles all the way down... |
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by adam Find all posts by adam](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) ![Visit Poster's Website Visit Poster's Website](templates/4WebHelp2/images/lang_english/icon_www.gif) |
![](images/spacer.gif) |
Hypergluco
Junior WebHelper
![Junior WebHelper Junior WebHelper](images/rank_1.gif)
Joined: 04 May 2006
Posts: 6
Location: London
|
Posted:
Fri May 05, 2006 8:57 am (18 years, 1 month ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
Hi Adam,
thanks for your reply.
The problem here is that in order to use /401.html I'd have to put the error document in the protected folder. When I do this, login failure brings the login dialogue back up continuously and doesn't render the error page, presumably because accessing the 401.html file requires authentication as well. The cancel button has no effect. Can I keep the error document in the public root and use ErrorDocument 401 /../401.html or something like it? I don't seem to be able to get this to work either.
James |
|
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by Hypergluco Find all posts by Hypergluco](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) ![Visit Poster's Website Visit Poster's Website](templates/4WebHelp2/images/lang_english/icon_www.gif) ![MSN Messenger MSN Messenger](templates/4WebHelp2/images/lang_english/icon_msnm.gif) |
![](images/spacer.gif) |
adam
Forum Moderator & Developer
![](images/rank_6.gif)
Joined: 26 Jul 2002
Posts: 704
Location: UK
|
Posted:
Fri May 05, 2006 9:01 am (18 years, 1 month ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
I see. Rather than putting the ErrorDocument line in the .htaccess file in the protected directory, you could put it in a .htaccess file in the parent directory. |
________________________________ It's turtles all the way down... |
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by adam Find all posts by adam](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) ![Visit Poster's Website Visit Poster's Website](templates/4WebHelp2/images/lang_english/icon_www.gif) |
![](images/spacer.gif) |
Hypergluco
Junior WebHelper
![Junior WebHelper Junior WebHelper](images/rank_1.gif)
Joined: 04 May 2006
Posts: 6
Location: London
|
Posted:
Fri May 05, 2006 9:13 am (18 years, 1 month ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
As I understand it, the .htaccess file that's in the protected (students) folder takes precedence over the one in the root. Having said that, when I have the errordocument .htaccess file in the root and the password protect .htaccess file in the students folder, it behaves exactly as it does when I try to put the 401.html file in the students folder - it just continually asks for authentication while failing to render the error page in the background.
Have a look: www.bcnh.co.uk/students
Cheers
james |
|
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by Hypergluco Find all posts by Hypergluco](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) ![Visit Poster's Website Visit Poster's Website](templates/4WebHelp2/images/lang_english/icon_www.gif) ![MSN Messenger MSN Messenger](templates/4WebHelp2/images/lang_english/icon_msnm.gif) |
![](images/spacer.gif) |
adam
Forum Moderator & Developer
![](images/rank_6.gif)
Joined: 26 Jul 2002
Posts: 704
Location: UK
|
Posted:
Fri May 05, 2006 9:36 am (18 years, 1 month ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
Can you paste the exact contents of the .htaccess file from the root directory? |
________________________________ It's turtles all the way down... |
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by adam Find all posts by adam](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) ![Visit Poster's Website Visit Poster's Website](templates/4WebHelp2/images/lang_english/icon_www.gif) |
![](images/spacer.gif) |
Hypergluco
Junior WebHelper
![Junior WebHelper Junior WebHelper](images/rank_1.gif)
Joined: 04 May 2006
Posts: 6
Location: London
|
Posted:
Fri May 05, 2006 9:45 am (18 years, 1 month ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
Here's the code in the root:
ErrorDocument 401 /401.html
ErrorDocument 403 /401.html
ErrorDocument 404 /401.html
ErrorDocument 500 /401.html
and the code in the students folder:
AuthUserFile /home/myid/.htpasswd
AuthGroupFile /dev/null
AuthName "Students"
AuthType Basic
<Limit GET POST PUT>
require valid-user
</Limit> |
|
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by Hypergluco Find all posts by Hypergluco](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) ![Visit Poster's Website Visit Poster's Website](templates/4WebHelp2/images/lang_english/icon_www.gif) ![MSN Messenger MSN Messenger](templates/4WebHelp2/images/lang_english/icon_msnm.gif) |
![](images/spacer.gif) |
adam
Forum Moderator & Developer
![](images/rank_6.gif)
Joined: 26 Jul 2002
Posts: 704
Location: UK
|
Posted:
Sun May 07, 2006 8:44 pm (18 years, 1 month ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
That's very strange. I can't see any reason why it should be acting like it is. Unless I'm missing something obvious, all I can think of is that it could be some kind of mis-configuration somewhere in httpd.conf. |
________________________________ It's turtles all the way down... |
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by adam Find all posts by adam](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) ![Visit Poster's Website Visit Poster's Website](templates/4WebHelp2/images/lang_english/icon_www.gif) |
![](images/spacer.gif) |
Hypergluco
Junior WebHelper
![Junior WebHelper Junior WebHelper](images/rank_1.gif)
Joined: 04 May 2006
Posts: 6
Location: London
|
Posted:
Mon May 08, 2006 11:21 am (18 years, 1 month ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
Is this a job for the host admin people? |
|
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by Hypergluco Find all posts by Hypergluco](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) ![Visit Poster's Website Visit Poster's Website](templates/4WebHelp2/images/lang_english/icon_www.gif) ![MSN Messenger MSN Messenger](templates/4WebHelp2/images/lang_english/icon_msnm.gif) |
![](images/spacer.gif) |
adam
Forum Moderator & Developer
![](images/rank_6.gif)
Joined: 26 Jul 2002
Posts: 704
Location: UK
|
Posted:
Mon May 08, 2006 11:24 am (18 years, 1 month ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
More than likely it is. They're in a much better position to figure out what's going on ![Smile](/forums/images/smilies/icon_smile.gif) |
________________________________ It's turtles all the way down... |
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by adam Find all posts by adam](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) ![Visit Poster's Website Visit Poster's Website](templates/4WebHelp2/images/lang_english/icon_www.gif) |
![](images/spacer.gif) |
Hypergluco
Junior WebHelper
![Junior WebHelper Junior WebHelper](images/rank_1.gif)
Joined: 04 May 2006
Posts: 6
Location: London
|
Posted:
Mon May 08, 2006 11:35 am (18 years, 1 month ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
Oh dear. 'We'll have to charge for that'. I'll send them a polite enquiry and let you know what they say.
Cheers
James |
|
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by Hypergluco Find all posts by Hypergluco](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) ![Visit Poster's Website Visit Poster's Website](templates/4WebHelp2/images/lang_english/icon_www.gif) ![MSN Messenger MSN Messenger](templates/4WebHelp2/images/lang_english/icon_msnm.gif) |
![](images/spacer.gif) |
|