Monday 17 December 2012

SEO Friendly URL in Asp.net

When you develop a asp.net website, and if you are managing lot or users or many operation related to database then you will notice you have to pass query string to do your work, you can also do that work in other ways but genrally everyone likes to use query string in asp.net.
 
Example URL

www.example.com/viewcart.aspx?pro_Id=2034
After Rewriting URL 

www.example.com/cart/product/2034
You can see First example is very unprofessional and second is better, but many people use first type of url in their application which makes their website unprofessional and their websites are not SEO Friendly, if you rewrite the url in a SEO friendly way then you will get good Results with your website.

How to Rewrite URL in Asp.net

First you need to Download Intelligencia.UrlRewriter created by Urlrewriter.net Then add this DLL file in your Bin Folder of your application.After that you have to make some changes in your application’s web.config file.

Your Web.config Structure

<configuration>
<configSections>
<section name=rewriter requirePermission=false type=Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter/>
configSections>
<appSettings/>
<connectionStrings>
<add name=connStr connectionString=Data Source=INV-DEV-SQL2K5;Initial Catalog=WidenerPortal;Persist Security Info=True;User ID=widener;Password=widener123a providerName=System.Data.SqlClient/>
connectionStrings>
<system.web>
<httpModules>
<add name=UrlRewriter type=Intelligencia.UrlRewriter.RewriterHttpModule, Intelligencia.UrlRewriter/>
httpModules>
Read more at http://www.geekstrack.com/2012/06/seo-friendly-url-in-asp-net.html#S3swiImr6FcHMVob.99

No comments:

Post a Comment

Note: only a member of this blog may post a comment.