도메인에 www자동으로 추가하기 정보
도메인에 www자동으로 추가하기본문
<head>와 </head>사이에 자바스트립트를 넣습니다
<script language="Javascript" type="text/javascript">
var host = location.host.toLowerCase();
var currentAddress = location.href;
if (host.indexOf("www")== -1)
{
currentAddress = currentAddress.replace("//","//www.");
location.href = currentAddress;
}
</script>
도메인을 domain.co.kr만 쳐도 자동으로 www.domain.co.kr로 바뀝니다.
<script language="Javascript" type="text/javascript">
var host = location.host.toLowerCase();
var currentAddress = location.href;
if (host.indexOf("www")== -1)
{
currentAddress = currentAddress.replace("//","//www.");
location.href = currentAddress;
}
</script>
도메인을 domain.co.kr만 쳐도 자동으로 www.domain.co.kr로 바뀝니다.
추천
7
7
댓글 6개
오호.. 현재페이지 유지하면서 페이지가 변경되는군요. 좋습니다.
http://happyjung.com/aaa=bbb --> http://www.happyjung.com/aaa=bbb 이동
추천 ~~~
http://happyjung.com/aaa=bbb --> http://www.happyjung.com/aaa=bbb 이동
추천 ~~~
좋은 팁 고맙습니다.
좋은팁 감사합니다
유용한 팁 고맙습니다.
감사합니다
아 좋은팁이네요