Setting Up URL Frame Forwarding
This guide explains how to set up URL frame forwarding to display content from another site while keeping your domain name visible in the browser's address bar.
About URL Frame Forwarding
URL frame forwarding allows your site to load content from another domain while keeping your own domain name in the browser's address bar.
For example, if your domain is example.com, you can display content from ruachost.com while visitors continue to see example.com in the address bar.
| Note: Unlike a traditional URL redirect, the browser's address bar does not update to the forwarded site's URL. URL frame forwarding can affect search engine rankings, so use it carefully. |
Setting Up URL Frame Forwarding
To set up URL frame forwarding, you use an <iframe> element with some CSS to ensure proper sizing and styling.
-
Open the
index.htmlfile of your site using cPanel File Manager or SSH with your preferred text editor. -
Copy and paste the following code into
index.html:
<html>
<head>
<title>Title</title>
</head>
<style>
body {
margin: 0;
padding: 0;
}
body, iframe {
width: 100%;
height: 100%;
}
iframe {
border: 0;
}
</style>
<body>
<iframe src="http://www.example.com"></iframe>
</body>
</html>
-
Replace the following:
-
www.example.comwith the URL of the site you want to load. -
Titlewith the page title you want displayed in the browser tab.
-
-
Save the changes to
index.html. -
Open your web browser and visit your domain. You should see the content of the external site while your domain name remains in the browser’s address bar.
| Note: As users navigate the external site within the <iframe>, your domain remains displayed in the address bar. Relative paths from the external site do not appear in the browser’s URL. |
More Information
For more details on the <iframe> element, visit:
https://www.w3schools.com/tags/tag_iframe.asp