if (document.location.protocol == 'https:')
{
  document.location.href = 'http://' + document.location.host + document.location.pathname + document.location.search;
};

