Question:

Why would .htaccess ask for username and password twice before displaying a web page?

by  |  earlier

0 LIKES UnLike

I've installed .htaccess on a server and if you type the correct username and password it asks you again and then shows you the page. What causes that?

 Tags:

   Report

2 ANSWERS


  1. had a similar concern, things to check.

    1. domain is redirecting.

    entering www.domain.com prompts once, then it redirects to domain.com it will prompt again.

    2. if it is a directory try adding a trailing slash at the end.

    eg. www.domain.com/files/ instead of just www.domain.com/files

    3. using ssl, from http: to https: you will get two prompts.


  2. It's to do with the domain.

    Say you got:

    www.domain.com

    and domain.com

    they would need to be authenticated separately, so if the visitor went to domain.com, and it had an image which was being loaded from www.domain.com, you'd have to reauthenticate to load this image.

    easiest way to fix it would be to use relative paths ("/images/1.jpg") rather then absolute paths (http://domain.com/images/1.jpg")

Question Stats

Latest activity: earlier.
This question has 2 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.