Site5 - Built For Designers & Developers MENU
Home  ›  Apache  ›  Apache: Set Up URL Masking On Your Site

Apache: Set Up URL Masking On Your Site

2 Comments

At times, you may have a site created in a different location or directory and don’t want your visitors to see the full path to your files. Fortunately, with just some simple steps, you can set up URL masking to have your visitors see what you want them to see without having to show them the full URL where the files are actually located. You would merely need to follow these steps.

For this example, we will have domain.com show the contents of domain.net/sitefiles however, you can replace these domain names and URLs with your specific domain names and URLs.

  • You would first need to make sure that your site is loading perfectly at domain.net/sitefiles. If it is loading correctly, you should have no problems.
  • Create an index.html file in the public_html (or www) folder on your domain.com site. Also, be sure that there is not an “index.php” file in the same directory as that will take precedence over the index.html file you have created and load up when visitors access your site.
  • Add the following text to the index.html file
<html>
<head>
<title>www.domain.com</title>
 
</head>
<frameset rows="100%,*" border="0">
<frame src="http://domain.net/sitefiles/" frameborder="0" />
<frame frameborder="0" noresize />
</frameset>
</html>

What this will do is create a frame on the domain.com site that will fill the entire page. Then, when your visitors access domain.com, they will only see the content of domain.net/sitefiles.

And that’s it! You have now used a frame to mask your site files’ URL!

Still have a question? Or need help?
See an error in this article or want to suggest a missing topic? Please leave us a comment below! If you need technical support with your account, please email us, chat live with a representative, or call us!

2 Comments

  • This may work fine. I have a wordpress site installed. The wordpress site has an index.php. How would I make this work with index.php being used.

    • With WordPress, as you describe, index.php is the index file and WordPress is heavily dependent on the URL it loads from, meaning it is fairly complicated to do – I would recommend contacting our support team with your specific requirements, and we will be more than happy to help get that set up for you.

Money Back Guarantees
Click to verify BBB accreditation and to see a BBB report.