V
V
Vitaly2015-09-22 10:46:01
JavaScript
Vitaly, 2015-09-22 10:46:01

How to open a site of another domain in the same window or frame?

There is a simple page on which the user enters his code, after which the server generates a page on an external domain (there is no access to that domain), if I then try to open this link in a frame - as a result, the page does not load and the console issues X-Frame-Options ' 'SAMEORIGIN' . If I just try to open a link in the same window (location.href or window.open , then for some reason it transfers me to Google.
This problem is only with this site :( if you just open youtube instead, then everything opens fine, everything works the same way if I run my start page just as a file in the browser, i.e. NOT on the server or local host everything works....

Answer the question

In order to leave comments, you need to log in

4 answer(s)
V
Vitaliy, 2015-09-22
@Scorpiored88

Unfortunately, I don’t have access to the site to which the link leads (
Can I somehow open that site with a substitution or without a referral?

V
Vyacheslav Ovchinnikov, 2015-09-22
@ova777

CORS

G
Gregory, 2015-09-22
@grigruss

It's all about routing. If the domain (computer) exists, but there is no access to it from the Internet, it will be possible to open it only if the domain from which we are trying to open has access to the closed one. If there is such access, you can make something like a staging post. The accessible server requests the page from the closed one, and forwards it to the browser. For the sake of interest, I did this when I was considering options for opening access to the site through the Internet and through a VPN with limited access.
Another question is if there is no access to the domain at all ... If it exists, then only the system administrator can help.

Z
Zakharov Alexander, 2015-09-22
@AlexZaharow

In principle, you can use nginx, and forward the path to an external site through it. Then on your page the path will be considered local, and nginx will redirect it to an external site. But here it is necessary to check how the loading of the page of the external site is arranged. If all the links on it are relative, then everything is ok. If not, then the matter is a little more complicated, but not hopeless.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question