Good day. There was an interesting task. It is necessary to display the contents of the site beta.site.ru On the domain mysite.com without redirection and iFrame. There is an idea that this can be done using DNS, but I don’t know how to do this. Does anyone know how to do this?

    2 answers 2

    From a neighboring subdomain will not work, because Same-origin policy . I will move away from the solution through domains and suggest more standard ways.

    1. XMLHttpRequest, XDomainRequest
    2. AJAX to your domain and server side make a request to the right place. If you want to save the session, you can try passing the session_id in the parameters.

      this can be done using DNS

      Yes, you can, using cname .

      only the site should be “agree” to give the same content under a different name. With a high degree of probability, you will not get at all what you would like.


      real life example:

      The domain name www.ya.ru described as a cname- record with the value ya.ru but, as you can see for yourself, the website ya.ru , having received the appeal under the name www.ya.ru , does not return the web page at all, but offers the browser a redirect (response code 302) to http://ya.ru .