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?


There is an answer on https://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>"
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.