Why does .htaccess ask for a second password box with Windows Media Player pages?

Posted on 2002-06-26
Last Modified: 2010-03-04

     I've run into a peculiar problem. After setting up .htaccess in a directory, and then pointing my browser to it, I get asked for a username and password. All well and good.

     Then, with an index.html page in front of me, this happens:

     - if I click on a link to a page in the same dir, with straight html in the sub page, I don't get asked for a password again. Again, all well and good.

    - However --- if I click on a link to a page in the same dir that has some Windows Media Player code in it, it pops up a second username/password htaccess box. The second box is slightly different, and has what looks like a media graphic icon on it. After plugging in the username/password again, the media file plays.

    So -- why does it demand the login a second time, and how can we edit the apache httpd.conf file, or the .htaccess file to eliminate the second login?


Peter F. Brown (the html/media code snippet is pasted below)


<!-- <OBJECT classid=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95
height=120 id=MediaPlayer type=application/x-oleobject
standby="Loading Windows Media Player components..."> -->

<OBJECT ID="MediaPlayer" WIDTH=160 HEIGHT=120
  STANDBY="Loading Windows Media Player components..."

<!-- ----------- 2 of 4 change below file name ------------- -->
<PARAM NAME="FileName" VALUE="es_q2.asx">
<PARAM NAME="AutoStart" VALUE="1">
<PARAM NAME="ShowControls" VALUE="0">
<PARAM NAME="ShowStatusBar" VALUE="0">
<PARAM NAME="ShowDisplay" VALUE="0">
<!-- ----------- 3 of 4 change below file name ------------- -->
<embed type="application/x-mplayer2"
width=160 height=120

Question by:peterbrown
LVL 15

Expert Comment

ID: 7113786

One of the reason why that is happening is due to different host is used in the URL for accessing the page.  For example if you are originally visited the page by, you get the first passwd box, and you will be fine is you move around the site, but if the link for the media is somehow changed to (for example), or, you will (definitely) be prompted for another password box.

Check Apache FAQ,

Might be directly related to your problem.

BAsed on you explanation, the password box has a different "caption" to it.  Most likely, there is a portion of your apache configuration that control access to media files. Check your apache configuration (/usr/local/apache/conf/httpd.conf), for directives like <Files>, and see if there is any ACL is imposed.  

Another place to look for is the .htaccess files itself.  Remember that the AUthentication, and Authorization can be confiured in httpd.conf, or the .htaccess file for each directories.

More information:

What is your OS/Apache version btw?

If on Unix, you might need root access to tweak your httpd.conf.  If your acl is configured at .htaccess files, then any user that has read-write access to the dirs (and the .htaccess file) should be able to modify the file.


Author Comment

ID: 7114449
Hi Samri,

    Thanks... however, I've resolved all those issues, and have already referenced the urls you mention, including the item on CanonicalName = off (which resolved the immediate second box -- however, we still have the box pop up when an html file with media is clicked on).

    There aren't any <Files> directives in the httpd.conf file that are referring to media files. Perhaps there should be -- in a positive sense.

    It would seem that the httpd.conf file is the culprit, but I haven't seen anything that refers to media files in relation to htaccess.

    Still looking for a solution....


LVL 15

Expert Comment

ID: 7115529

Could you try to isolate the problem.  If possible, try to disable authentication on the folder, ie. rename .htaccess to something else (maybe htaccess-saved)., and try to emulate the steps.  You might need to close all browser, and reopen (since the credential are cached for that session).

All I am trying get is, whether the password box will still pops apprear or not.

If it is still, I would suspect that there much be some ACL defined somewhere (maybe the Files, Location, LocationMatch, etc).  Check or any .htaccess files which might be lying around somewhere withing those sub-folders.

By the way, whem you mention the 2nd password box, did you use the same username/password combination to go thru?


Author Comment

ID: 7117638
Dear Samri,

    Yes, we've disabled it (the password box doesn't pop up) and checked sub-folders. And yes, the user/pass combo is the same. We've also checked the 3 .conf files in the httpd.conf directory and haven't found anything strange.

    A consultant friend suggested that Windows Media Player checks the .htaccess files by itself, without registering that the browser has already approved the directory.

    Still looking for a solution :-)

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

LVL 15

Expert Comment

ID: 7118334

>>A consultant friend suggested that Windows Media Player checks the .htaccess files by itself, without registering that the browser has already approved the directory.

It's kinda strange.

Anyway, if the .htaccess is totally disable how did the WMP could perform user authentication.

Another thing to try is checking you .htaccess for "Satisfy" directive, and try to use "Satisfy any".  This would be as good as "no" authentication since any client from "Allow from" or have valid username/password would be allowed access.  But this is for testing only.

Within your HTML code of Javascript (or any code at all) does it call/load an external code from a different dir (or the same directory) buy by different URL ref (remember, and is different, and will cause re-Authentication) - Just checking.

Other than that I am pretty much stucked myself.

Author Comment

ID: 7118653
Dear Samri,

    Thanks for trying :-)

    Still looking ... anyone else have an idea?



Expert Comment

ID: 7266479
Your consultant friend is right!
I have the same thing on my box..
I logon to the webserver through a browser and click an mp3.
Mediaplayer then pops up a user/pass box as well.
When associating mp3 with winamp the file isn't even run/served and winamp doesn't start.

I have no solution but i thoght i'd let you know.
LVL 15

Expert Comment

ID: 9690986
No comment has been added lately, so it's time to clean up this TA.

I will leave a recommendation in the Cleanup topic area with the following recommendation for this question:


Please leave any comments here within the next seven days.


EE Cleanup Volunteer

Accepted Solution

Computer101 earned 0 total points
ID: 9735844
PAQed, with points refunded (75)

E-E Admin

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now