Languages/JavaScript

postmessage the target origin provided does not match the recipient window's origin

반응형

 

postmessage the target origin provided does not match the recipient window's origin

개발자도구에서 이런 에러메시지가 나온다면 두 url을 잘 들여다보자. 한 쪽에는 www.가 붙어 있고 한 쪽에는 없는 경우라면 그게 문제다. 사용자가 www.address.com  으로 들어온 경우와 address.com 으로 들어온 경우. 

나는 nice module을 붙인 부분에서 이런 문제가 발생했다. 갔다 오면서 뭐가 안 맞은 모양. 변수 설정을 케이스를 나눠 해줘도 먹히지 않아, 리다이렉션 처리를 해줘야 했다. apache 서버 설정을 바꿔주는 방법 링크를 첨부해 둔다. 나중에 같은 일이 생기면 직접 해야 할수도 있으니까.. 

카테고리 없음으로 하려다가 프론트단 문제니까 javascript로 우선 넣어둠... 하지만 수정은 백단에서 해야 할 수도 있고... 아무튼 그럼. 

 

How to redirect between non-www and www URL in Apache

You can host websites on a URL that starts with or without www. The choice could be personal, though sometimes certain CDN specifically require websites to be hosted on a subdomain (www for example) to work. Either way, you can first configure your Apache

www.simplified.guide

 

728x90
반응형