Go Premium for a chance to win a PS4. Enter to Win


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

Posted on 2002-06-26
Medium Priority
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 http://www.somewhere.com/something.html, you get the first passwd box, and you will be fine is you move around the site www.somewhere.com, but if the link for the media is somehow changed to http://somewhere.com/media.avi (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?

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.


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 :-)

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 aa.bb.cc.dd" 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 http://www.domain.com/code.js, and http://domain.com/code.js 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
Introduction As you’re probably aware the HTTP protocol offers basic / weak authentication, which in combination with the relevant configuration on your web server, provides the ability to password protect all or part of your host.  If you were not…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Suggested Courses
Course of the Month11 days, 5 hours left to enroll

886 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