Search engine friendly URLs using ASP.NET (C#.NET)
Each year companies and individuals spend millions of dollars on websites
that depend on databases to offer dynamic content. Yet these sites never receive
the exposure they deserve. Database driven sites are used because their administration
is much easier than the sites with static content.
Usually, all it takes to update the contents of a database driven web site it making
changes to certain tables in the database.
Unfortunately, most of these database driven web sites rely heavily on parameters
to display contents since parameter passing is the easiest way to pass
information between web pages.
Yet, most search engines cannot or will not list any dynamic URLS. Dynamic URLs are said to contain elements such as ?, &, %, +, =, $, cgi-bin, .cgi. Hence, the pages which the hyperlinks point to will be ignored by the Web spider indexing the site.
I have been searching many top search engines for information on creating a search engine friendly web site using ASP.NET (C#. NET) and have not been able to find anything. So, I thought it would be a good idea to create an article and share it with the rest of the world.
Goal
Instead of sending parameters like
http://www.mydomain.com?pageid=4 which is not search engine friendly
we want to change it to
http://www.mydomain.com/page4.aspx
Prerequisites
In your Global.asax file, modify the Application_BeginRequest event as the following,
In the above code, URLs of incoming requests are scanned to determine if the URL includes “pageX.aspx†|