aaa.com 도메인을 aaa.kr로 변경하려고하는데요....
aaa.com에 index.html안에
<html>
<head>
<title>페이지 이동</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script language="JavaScript">
function forwarding()
{location = "http://aaa.kr"}
</script>
</head>
<body onLoad="setTimeout('forwarding()', 100)">
</body>
</html>
이렇게 만들어서 aaa.com으로 들어오는 사람들을 aaa.kr 로 들어오게 했는데요...
aaa.com/1
aaa.com/2
등 aaa.com 주소뒤에 모가 붙으면 aaa.kr로 이동하지 않는데 aaa.com/1 과 같이 뒤에 주소가 붙어도 무조건 aaa.kr로 들어오게 하고 싶은데
어떡해해야하는지 알려주시면 감사하겠습니다....
|
답변 1개 / 댓글 1개
채택된 답변
+20 포인트
2017-08-17 (목) 15:33:48
PHP
Copy
if ($_SERVER['SERVER_NAME'] !== 'aaa.kr') { // header('Location: http://aaa.kr'); header('Location: http://aaa.kr' . $_SERVER['REQUEST_URI']);}
JavaScript
Copy
if (document.domain != 'aaa.kr') { // location.replace('http://aaa.kr'); location.replace('http://aaa.kr' + location.pathname + location.search); }
답변에 대한 댓글 1개
2017-08-18 (금) 15:39:07
답변을 작성하려면 로그인이 필요합니다.
알려주시면 감사하겠습니다....