자바 스크립트를 이용한 www 도메인으로 이동 시키기
아래 자바스크립트 소스를 head.sub.php 파일의 <!doctype html> 위에 적용해서 사용해 보세요....^^
[code]
<script type="text/javascript">
//<![CDATA[
var address = location.host.toLowerCase();
if (address.indexOf("www") == -1)
{
location.href="http://www." + address;
}
if(typeof(parent.frames[0]) != "undefined") {
top.location.href = "http://www.$g5['url']";
}
//]]>
</script>
[/code]
HSTS 를 사용하지 않는 서버에서는 내용중에 http를 https 로 바꿔서 사용 하세요....^^
|
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기
댓글 9개
top.location.href = "<?php echo $_SERVER['HTTPS']?"https://www.":"http://www.";?><?php echo $g5['url'];?>";
이렇게 수정하면 어떨까요?
수정했는데 이런오류가 있군요