How to Configure URL Masking in Plesk Windows Hosting
When you want a website to display a different URL while showing the same content. This article explains how to configure URL masking in Plesk for Windows Hosting.
What is URL Masking and how it differs from Redirection?
URL Masking mainly hides your long domain (or URL) and tracks the clicks. It is changing the structure of the Website URL while still showing the same website content.
Example of URL masking:
Original URL : http://domain.com/about-us.html
Masked URL on the Browser : http://domain.com/about-us
Redirection means redirecting one URL to another completely different URL.
Example of redirection:
Original /Source URL : http://domain.com/aboutus.html
Destination : http://www.domain2.com/about-us
To Achieve URL Masking on your Windows Hosting order
Update the following code in your web.config file
NOTE: Remember to take the backup of web.config file before making the changes.
<configuration> <system.webServer> <rewrite> <rules> <rule name=”RedirectDefaultPage” stopProcessing=”true”> <match url=”^index\.html$” /> <action type=”Redirect” url=”/” /> </rule> </rules> </rewrite> </system.webServer> </configuration>
Note:
- The above code redirects http://domain.com/index.html to http://domain.com/
- The same code to redirect http://domain.com/about-us.aspx to http://domain.com/about-us would be like this:
<rule name=”RedirectDefaultPage” stopProcessing=”true”> <match url=”^about-us\.aspx$” /> <action type=”Redirect” url=”/about-us” /> </rule>