Website URL frame in cPanel

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:-

  1. Log in to cPanel.

  2. Go to Files > File Manager.

  3. 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.
  4. In the root directory of your domain, create a new file called index.html by clicking on File.

  5. Right-click on the file and select Edit.

  6. Add the code to set up the URL frame, then click Save Changes.

That’s it!


Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.