URL masking

Hello Friends,
I feel happy to meet you all after a long gap. I hope you all are doing good. Today let us see how can we mask the URLs in windows via web.config.

First let us see what is URL Masking and how it differs from Redirection. Redirection means redirecting one URL to another completely different URL.
Eg : http://domain.com/aboutus.html
Like i said, here the redirection is done from one URL to entirely different URL.

Whereas URL masking is like changing the structure of the Website URL though showing up the same website content.
Eg: http://domain.com/about-us.html

It is very similar to the Permalink Settings we see in WordPress. Please note that we cannot achieve URL masking via Redirection. Since both the URLs are going to refer to the same content, using redirection code to achive URL masking may cause “Redirection Loop” showing up the error:
The website Redirects too many times

We have the “tested-OK” web.config code to achieve this URL masking.
<rule name=”RedirectDefaultPage” stopProcessing=”true”>
<match url=”^index\.html$” />
<action type=”Redirect” url=”/” />

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” />

I hope it is clear now and we will be able to rewrite the above mentioned code accordingly as per our requirements.

So… Until next time Friends….. Have a great day !!!! 🙂 🙂 🙂



Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s