开发者

HTTP authentication using htaccess/htpasswd ...dialogue box comes up twice

I have a site that has the main path under password protection. I also have a subfolder that have a separate (htaccess/htpasswd) password protection.

For some reason, when I access the subfolder, I'm asked to put in my id/password twice. All of the files that are referenced are under the subfolder.

What should I be doing to troubleshoot this? I've tried this on different browsers and it's the same behavior.

There is one main html page with a .swf (the only开发者_开发技巧 thing on the page)...it loads other assets but they are within the same subfolder.


If you're loading an XML file or something from the SWF off of a different domain, that could cause it. I can't check, but it might even happen if the SWF loads on HTTP, and the XML is on HTTPS or something like that.


If you've created a rewrite directive...

You're asked for Username/Password when "yoursite.com" is requested. Then, the URL is automatically rewritten according to .htaccess file, a second request is made for "www.yoursite.com", and you're asked for a Username/Password again. If you type the URL in your browser's address bar the way your .htaccess rewrites addresses, then you will only be prompted for your Username/Password once.

In summary, if your .htaccess file rewrites "yoursite.com" as "www.yoursite.com", when you request "yoursite.com" you will be prompted for your Username/Password twice; once for "yoursite.com" and a second time for "www.yoursite.com". When you request "www.yoursite.com", you will be prompted for your Username/Password once.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜