|
| ||||
You are in: Home > Articles > Search Engine Friendly URLs using ASP.NET (C#.NET) | ||||
Articles & Tutorials |
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. GoalInstead 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 PrerequisitesIn 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”, where X=1,2,3…n Your codeNext create a file Process.aspx which would display your web site content based on the pageid parameter (pageid=1…n) just like you would do normally. Ex. <%
FinallyIssue a test request http://www.yourdomain.com/page12.aspx DoneHere even though you are issuing a search engine friendly request, in the background you’re managing your parameters like you would normally do with parameters. Are you a freelance web designer, looking for more work or a professional web design company looking for more website projects to complete? If so, we can help you. HOW IT WORKS |
Web Design Directory |
||
![]() Web Design Companies, Web Design Services, Web Design ResourcesCopyright The UK Web Design Company (UKWDC), London, UK 2003-2004 All rights reserved |
||||