Mobile app version of vmapp.org
Login or Join
Kristi941

: Http-basic auth, else placeholder-page Is it possible to show a http-basic-auth, and when someone fails that test, show a certain HTML-placeholder-page? If so, how can I achieve that?

@Kristi941

Posted in: #Apache #Authentication #Htaccess

Is it possible to show a http-basic-auth, and when someone fails that test, show a certain HTML-placeholder-page?
If so, how can I achieve that?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Kristi941

1 Comments

Sorted by latest first Latest Oldest Best

 

@Pierce454

There is an answer on stackoverflow.com/questions/1726860/apache-authentication-redirect-on-failure-reliably
Basically you send a html file as error document that does a redirect to your placeholder page:

<Location "/protected">
AuthUserFile /path/to/users
AuthName "This is protected area"
AuthGroupFile /dev/null
AuthType Basic
Require valid-user

#ErrorDocument 401 /register.html
ErrorDocument 401 "<html><meta http-equiv="refresh" content="0;url=/register.html"></html>"
</Location>

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme