File works on http, not on https

Richard G

Verified User
Joined
Jul 6, 2008
Messages
13,889
Location
Maastricht
I got a html file for some radio stations. I call this file from my site which is https now and it's called in a popup window.

It's called like this from my site:
Code:
<a style="text-decoration:none" href="#" onclick="window.open('https://www.mysite.com/radio.html', 'newwindow', 'width=350, height=300'); return false;"><b>» Radio</b></a><br />
It does not matter if I change this to http becaue the .htaccess will redirect http to https so we will end up with https anyway.

This is my radio.html file:
Code:
<!DOCTYPE html>
<html>

<head>
  <title>Radio</title>
</head>

<body>
<DIV align="center" style="color:#fff;"><P align=center><SELECT onchange=PlayIt(this.value) name=player>
<OPTION value="#">= Select Station =</OPTION>
<OPTION value="http://www.someradio.nl/someradio.asx">1. Some Radio</OPTION>
<OPTION value="http://www.anotherradio.com/anoradio.asx">2. Another Radio</OPTION>
<OPTION value="http://www.thirdradio.org/thirdradio.pls">3. Thirdradio</OPTION>
</SELECT>  <SPAN style="FONT-WEIGHT: bold"></SPAN></P></DIV>
<DIV id=music style="TEXT-ALIGN: center">
<P>
<OBJECT id=MediaPlayer2 codeBase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab# Version=5,1,52,701" type=ap
plication/x-oleobject height=200 standby="Loading Microsoft Windows® Media Player components..." width=300 classid=CLSID:22d6f3120f6-11d0-94ab-0080c74c7e95>
<EMBED height="200" width="300" showstatusbar="1" url="" uimode="full" showcontrols="true" pluginspage="http://microsoft.com/windows
/mediaplayer/en/download/" type="application/x-mplayer2" loop="False" autostart="True"></EMBED></OBJECT></P></DIV>
<DIV style="TEXT-ALIGN: center"> </DIV>
<DIV style="TEXT-ALIGN: center"></DIV>
<P style="TEXT-ALIGN: center">
<SCRIPT type=text/javascript>
function PlayIt(what){
document.getElementById('music'). innerHTML='<object width="300" height="200" '
      +'classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" '
      +'codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" '
      +'standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">'
      +'<param name="url" value="'+what+'">'
      +'<param name="uiMode" value="full">'
      +'<param name="autoStart" value="true">'
      +'<param name="loop" value="false">'
      +'<embed type="application/x-mplayer2" '
      +'pluginspage="http://microsoft.com/windows/mediaplayer/en/download/" '
      +'showcontrols="true" uimode="full" width="300" height="200" '
      +'src="'+what+'" autostart="1" loop="False">'
+'</OBJECT>'; }
</SCRIPT>
</P>
</body>
</html>

In https, this popup window will load, but as soon as I select a radio station, the windows will become blank with only the radio selection bar and the selected radio in there.

Normally you will have this too, but like in the beginning you will see the VLC icon too (or WMP).

What do I need to change to be able get this working in https? Normally external links do not need to be converted to https.
 
The browser blocks all none-ssl content, so you got blank page. try change all http:// => https:// in your HTML
 
Are you sure? If I put the radio.html on an external site, just http, it works without any issues.
The radio stations are not all https and neither are the microsoft links, so if I change it to https it won't work anyway, tested that already.
 
Also tested with all https, does not work. Placing the radio.html at any other site without https works fine.
So it must be the recall to https for the popup caused by the .htaccess redirect.

What is the best way to exclude 1 file to be redirected to https? Google is no fun, because there are a ton of different solutions to be found there.

This is what I'm using now to redirect to https:
Code:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
SetEnvIf Cookie "eu-opt-in=1" opted_in
Header always unset Set-Cookie env=!opted_in
 
Back
Top