Uploading an external webpage to my page without redirecting to another URL

So what I want to do is create a subdomain on my website and upload it to an external website without actually navigating to that website. For example:

google.mydomain.com loads google.com, but the URL bar reads google.mydomain.com.

How can I do it?

I tried this one but could not understand.

Attempt:

IFrame

  • I want the page to occupy the entire screen for each personal computer. Can I set it to 100% instead of x number of pixels?

  • I want to remove scrollbars, but it is not supported.

+7
source share
3 answers

You can use either Iframe or file_get_contents ();

Iframe:

<iframe src="http://google.com" style="width: 100%; height: 100%;"> 

file_get_contents ():

 <?php echo file_get_contents('http://google.com'); ?> 

With file_get_contents (), you should beware of a website that you extract from using relative URLs, which will break CSS, images, Javascript, etc.

+10
source

You will not be able to use the php enable function, since this is not a resource located on your server.

One option you can explore is loading everything as iframe content: see http://www.w3schools.com/tags/tag_iframe.asp for some details on the iframe html element

+3
source
  • iframe is no longer supported in html5
  • it also works on html5
  • Easy to add or remove

Example:

  <body onload="window.location.href='https://www.google.com/'"> </body> 
0
source

All Articles