|
Home > Archive > Web Servers on Unix and Linux > December 2004 > Setting up custom error page with .htaccess protection
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Setting up custom error page with .htaccess protection
|
|
| sgarciafortyone@yahoo.com 2004-12-16, 8:45 pm |
| I am trying to set up the .htaccess authentication system such that a
customized error page is displayed when an unauthorized user tries to
access the protected directory.
Can the
Require Directive, Require Valid-User
and
Error Directive, ErrorDocument 401 /Error1.html
be used together in a single .htaccess file?
Also, when a wrong ID/PW combo is provided, the dialog box that asks
the ID/PW pops up a total of 3 times before the canned 401 Error
message (unauthorized access) gets displayed. How can I change this so
that the Error message gets displayed after the wrong user ID/PW is
provided in the first instance itself?
Thanks.
Stephen
| |
| sgarciafortyone@yahoo.com 2004-12-19, 5:47 pm |
| Can some one help please????
Thanks,
Stephen
sgarciafortyone@yahoo.com wrote:
> I am trying to set up the .htaccess authentication system such that a
> customized error page is displayed when an unauthorized user tries to
> access the protected directory.
>
> Can the
> Require Directive, Require Valid-User
>
> and
> Error Directive, ErrorDocument 401 /Error1.html
>
> be used together in a single .htaccess file?
>
> Also, when a wrong ID/PW combo is provided, the dialog box that asks
> the ID/PW pops up a total of 3 times before the canned 401 Error
> message (unauthorized access) gets displayed. How can I change this
so
> that the Error message gets displayed after the wrong user ID/PW is
> provided in the first instance itself?
>
> Thanks.
> Stephen
| |
| Juha Laiho 2004-12-19, 5:47 pm |
| sgarciafortyone@yahoo.com said:
>I am trying to set up the .htaccess authentication system such that a
>customized error page is displayed when an unauthorized user tries to
>access the protected directory.
I think what you're attempting to do can't be done with Basic
Authentication (the auth. type that uses the pop-up dialog).
Instead, you should build a form-based authentication system;
this allows much more complete control of the browser behaviour.
--
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)
| |
| sgarciafortyone@yahoo.com 2004-12-19, 5:47 pm |
|
Juha Laiho wrote:
> sgarciafortyone@yahoo.com said:
a[vbcol=seagreen]
to[vbcol=seagreen]
>
> I think what you're attempting to do can't be done with Basic
> Authentication (the auth. type that uses the pop-up dialog).
>
> Instead, you should build a form-based authentication system;
> this allows much more complete control of the browser behaviour.
> --
> Wolf a.k.a. Juha Laiho Espoo, Finland
> (GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M
V
> PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++
y++++
> "...cancel my subscription to the resurrection!" (Jim Morrison)
Does this mean that the dialog box that asks the ID/PW pops up a total
of 3 times because of an Internet Explorer setting?
| |
|
|
<sgarciafortyone@yahoo.com> wrote in message
news:1103247704.626585.19720@z14g2000cwz.googlegroups.com...
> I am trying to set up the .htaccess authentication system such that a
> customized error page is displayed when an unauthorized user tries to
> access the protected directory.
>
> Can the
> Require Directive, Require Valid-User
>
> and
> Error Directive, ErrorDocument 401 /Error1.html
>
> be used together in a single .htaccess file?
Yes. Your ErrorDocument can be CGI code, through which you can customise
your errors messages.
If you want cutsomise at .htaccess level (i.e. you want to use ErrorDocument
at .htaccess), check if you are allowed to do that in apache config (check
for AllowOverride directive and FileInfo attribute).
> Also, when a wrong ID/PW combo is provided, the dialog box that asks
> the ID/PW pops up a total of 3 times before the canned 401 Error
> message (unauthorized access) gets displayed. How can I change this so
> that the Error message gets displayed after the wrong user ID/PW is
> provided in the first instance itself?
This can't be customized. Each user agent is works differently. All that
server does is continouesly sending 401 status to user agent. On receiving
the same user agent (browser) displays dialog box. IE displays it three
times and then shows the error message. netscape works differently.
> Thanks.
> Stephen
>
| |
| Juha Laiho 2004-12-20, 5:48 pm |
| sgarciafortyone@yahoo.com said:
>Juha Laiho wrote:
>
>Does this mean that the dialog box that asks the ID/PW pops up a total
>of 3 times because of an Internet Explorer setting?
Yep; read the other response by Holla; it seems to be correct description
of how things work with basic authentication.
--
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)
| |
| sgarciafortyone@yahoo.com 2004-12-20, 8:46 pm |
| Juha Laiho wrote:
> sgarciafortyone@yahoo.com said:
that[vbcol=seagreen]
tries[vbcol=seagreen]
total[vbcol=seagreen]
>
> Yep; read the other response by Holla; it seems to be correct
description
> of how things work with basic authentication.
> --
> Wolf a.k.a. Juha Laiho Espoo, Finland
> (GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M
V
> PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++
y++++
> "...cancel my subscription to the resurrection!" (Jim Morrison)
>
>
>
Thanks much, folks!
Stephen
|
|
|
|
|