カテゴリー
diary

jsでhttpsからhttpにリダイレクト

.htaccessもPHPもつかえなくてしゃーなしで

<script language="javascript">
  strURL = location.href;
  if ( strURL.indexOf( "http://" ) == -1 ) {
    strURL = strURL.replace( "https://", "http://" );
    document.location.href = strURL;
  }
</script>