A URL Frame functions similarly to a URL redirect, but with one difference, instead of redirecting visitors to a different web page, it loads the content from another server and displays it within a frame on your site. Crucially, after the content is loaded, the browsers address bar will still show your domain name, not the redirected one.
Implement URL Frame Using HTML <iframe> Tag
The <iframe> tag allows you to embed another web page within your current page. To set up a URL Frame, you need to insert the following HTML code into your site's main index file. Replace "example.com" with the URL you want to display, and "Site Title" with the name you'd like to appear in the browser tab.
<html> <head> <title>Site Title</title> <style> body { margin: 0; padding: 0; } body, iframe { width: 100%; height: 100%; } iframe { border: 0; } </style> </head> <body> <iframe src="http://example.com"></iframe> </body> </html> |
To edit the index file for the domain, do the following:-
Log in to cPanel.
Go to Files > File Manager.
Navigate to the document root for your domain where you want to set up a URL frame.
- If it's the main domain for your hosting account, go to the public_html folder.
- If it's an addon domain, the folder will be public_html/addondomain.com.
In our example, we'll use public_html.
In the root directory of your domain, create a new file called index.html by clicking on File.
Right-click on the file and select Edit.
Add the code to set up the URL frame, then click Save Changes.
That’s it!