GICT knowledge base
How to do URL Masking?
Published
URL masking mean that you would like to hide the actual path of the website file. In order to do that, you may always use frame tag. It also means that the visitors to the domain name will be forwarded to your destination website, however the URL in their browser address bar will remain the same. The URL masking is also known as Stealth Redirection or URL Hiding. This will ensure that your visitors see the original domain name and not the destination URL.
For example, you would like your main page to be linked to other website or subfolder, then place the below script in a file and name the file as index.html in your website root directory.
<HTML>
<HEAD>
<TITLE>This is test </TITLE>
</HEAD>
<FRAMESET>
<FRAMESET rows>
<FRAME src=”http://www.domain.com/file.ext“>
</FRAMESET>
</HTML>
URL Masking with .htaccess
In case you would like to access a certain URL for your domain name, but do not display it in the web browser address bar – here is how you can accomplish it using an .htaccess file.
A sample rewrite rule will look like this:
RewriteEngine On
RewriteRule ^something/?$ /something/else/
This way each time someone accesses:
http://yourdomain.com/something
the actual content that will be displayed will be for:
http://yourdomain.com/something/else
while the URL will remain unchanged.
How does URL Masking work?
In case of URL Masking the Domain Forwarding server sends the client a Frames page where the Frame Source contains the destination URL you have specified. This ensures that the URL in the address bar of the browser does not change though the client sees the destination page. URL masking mainly hides your long domain and track the clicks. Cloaking is in fact a search engine optimization (SEO) technique in which the content presented to the search engine spider is different from that presented to the user’s browser. This is done by delivering content based on the IP addresses or the User-Agent HTTP header of the user requesting the page. When a user is identified as a search engine spider, a server-side script delivers a different version of the web page, one that contains content not present on the visible page, or that is present, but not searchable. The purpose of cloaking is sometimes to deceive search engines so they display the page when it would not otherwise be displayed (black hat SEO). Beware of using this method. Many of the major search engines normally delete your page or even your entire website from their databases if they are “cheated” with this technique.
Three URL masking techniques are fairly easy to implement:
With an iframe tag
An iframe large enough to use up the entire browser window contains the content at a different URL.
With an Apache rewrite directive
The URL affected by the Apache rewrite is in the browser’s address bar while the content in the browser window is from a different URL.
With web page retrieval software
A web page is retrieved from a different URL and inserted at the web page of the current URL.
How to setup a masked Redirect using cPanel
1) Login to your cPanel.
2) Go to File Manager/Web Root.
3) Click on New File and name it index.html.
4) Then right click the index.html file and select edit.
5) Now go to the webstart Forward website.
6) Scroll down to ‘How do I create a masked forward? (frames)’
7) Enter the Title.
8) Then enter the destination url and click submit.
9) This will then generate the code that you need to paste into your index.html file.
10) Save your index.html page.
That is it. Whenever you go to your website it will redirect you while showing your website.
If you need any further assistance please reach our support department.
Related guides
How to Restrict an SSH Key to One Command
Restrict an SSH key to one command with authorized_keys options. Protect the command and check that unwanted shell and forwarding access are denied.
Linux and CommandsSelf-Hosted Video Processing With FFmpeg: A Practical Guide
Learn how to self-host video processing on a VPS using FFmpeg, with practical commands for conversion, compression, thumbnails, and automated workflows.
Linux and CommandsHow to use nohup: Commands in Linux That Survive Terminal Closes
Keep commands running after you close the terminal. nohup examples with wget, Python, rsync, and Docker on any VPS.
Linux and CommandsHow to Fix “Too Many Open Files” Error on Linux Servers
Learn how to fix the "Too Many Open Files" error on Linux servers by understanding file descriptors, adjusting limits, and diagnosing leaks effectively.
