How to set mask redirection for a site

Hi Friends,

Today I will show you how to set a mask redirection for your site in Linux server.

What is Mask Redirection?

It is the act of hiding the actual domain name of a website from the URL field of a user’s web browser in favor of another name.

How to achieve this?

There are many ways to do this, including the following examples:

  1. HTML inline frame or frameset so a frame embedded in the main website actually points to some other site.
  2. URL rewriting (e.g., mod_rewrite) or aliases to have the web server serve the same page for two different domain names.
  3. Virtual hosting whereby the HTTP server serves up several different websites based only upon the content of the “Host” HTTP Request Header.
Source: Wikipedia

In this post, I will discuss how to achieve it via HTML inline frame or frameset.


Soruce domain: (Note: this is a just a test domain hosted locally in the server for testing purpose).

Destination domain:

We want to redirect the domain to in such a way that the domain should load the contents of, but the domain should show in browser.

How to achieve this?

You need to create a index.html file in the document root of the source domain i.e. with the below contents:




</head><frameset rows="100%" scrolling="yes" border="0">

<frame src="">



That’s it..!!  🙂

IMPORTANT: “src” field will filled up with the destination domain (to which we want to redirect).

Once the URL is masked it displays the URL mask rather than the original URL/domain name. Masking does not affect the content of the actual website, it only covers up the original URL/domain name. Domain masking prevents users from being able to see the actual domain website, whether it be due to length or privacy/security issues.


Without redirection:


After setting iframe in index.html:



Also if you have SSL for the site:, then you can add the below code in .htaccess file so that the domain should redirect from http to https and then it will load the contents of destination domain ( Put the below code in .htaccess file:


RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$$1 [R,L]


This way your domain will load with https protocol.

If you feel dificulty in doing so, please feel free to comment in the comment section. I will help you to achieve this. 🙂

Have a great day..!!!!

Powered by Facebook Comments

Be the first to comment

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.