How to Set URL masking by using index files and .htaccess in cPanel ?
URL Masking means that visitors to the domain name will be forwarded to your destination website, however the URL in their browser address bar will remain the same. Also known as Stealth Redirection or URL Hiding or loaked URL forwarding, or link cloaking, this will ensure that your visitors see the original domain name and not the destination URL. Silicon House Provides FREE cPanel and WHM for Cheapest Cost ..!!
Use :
- The actual domainname was not displayed in addressbar for users
- Mask/hide your long domain and track the clicks
Steps to follow to set URL masking :
Method 1 : URL masking with index.html
1] Login to cPanel and click file manager
2] Under Public_html , create a file named as index.html /index.php
3] Right click the index.html/index.php file and select edit.
4] You may select and use the “Use Code Editor” to have a better view on code.
5] Edit the Code below and paste to index.php/index/html
6] Then click save changes
7] Then test your domainname.
Method 2: URL Masking with .htaccess
The following method will allow you to mask certain part of your website’s address.
For example, when someone opens up:
the actual content that will be displayed can be the one under:
http://domainname/example/anything
although the URL in the visitor’s address bar will still remain http://domainname/example.
You can achieve this by adding rules similar to the ones below into your domain’s .htaccess file :
=====
RewriteEngine On
RewriteRule ^example/?$ /example/anything/
=====
*replace example and anything with your filenames
An easy way to modify the .htaccess file in your SiteGround hosting account is via the File Manager in cPanel.