Url rewriting asp.net 3.5
I have implemented URL rewriting using Intelligencia, everything works perfectly.
now if i have an anchor i could do somenthig like
<a href="../TestPage">Test</a>
with the seo friendly url olready in place
or do i have to do somenthing like
<a href="<% GetSeoUrl("../TestPage.aspx")%>">Test</a>
public string GetSeoUrl(string url)
{
if(url == "../TestPage.aspx") return ../TestPage;
}
This will allow me to manage from a central location all the URLs.
I am working on .net 3.5 Web Form
But what are the implications of both approaches?Is it going to be slower?less effici开发者_高级运维ent?is the right way to do it?
Thanks
I think second way is right way to do it. ( Managing from Central Location ) also,i don't think there will be any SEO implication using this as the final URL will be same but second one is rendred from server. It might be littlebit slow but not noticable. as it runs some server code to generate url while first cenarion there won't be any processing.
I see you are using .NET
, you can to do this already developed solution from ASP.NET MVC Framework called URL routing.
Read this http://weblogs.asp.net/scottgu/archive/2007/12/03/asp-net-mvc-framework-part-2-url-routing.aspx
I would do the first one. The URL is the contract. Using the second approach may make you think that you can easily change the URL by updating the function. Changing the URL would cause seo issues.
精彩评论