So I am trying to get a site I am working on, more SEO friendly. The site has been built using the Web Page model(with Visual Web Developer Express). Now I am completely new to this, so any help would be greatly appreciated. So here is the scenario. The
site has dynamically generated content specific to all 50 states in the US. Currently the URL's take the form
http://www.mydomainname.com/products/{stateID} . All the stateID's and their corresponding state names are stored in a SQL Server database. What I want to achieve is have the url's take the form of
http://www.mydomainname.com/products/{fullstatename}. So what is the best way to achieve this? From the little research I have done, you could(correct me if I am wrong) do this previously in ASP.NET using "URL rewriting". But I have also come
across what is called "URL routing" which is apparently simpler and better. Is that the case? What is the difference between the two?
I would appreciate any help pointing me in the right direction. If possible, a step-by-step tutorial on how to produce SEO friendly URL's in the ASP.NET Web Page model would be greatly appreciated.
Thanks Mike. Currently giving this a shot. But currently encountering an issue trying to install the WebPageRouteHandler package. Getting an error. I am using Visual Web Developer and tried using both the console(Install-Package WebPageRouteHandler) and
the Nuget Package Manager, and keep getting the following error:
Element not found. (Exception from HRESULT: 0x8002802B (TYPE_E_ELEMENTNOTFOUND))
Thanks Mike, you have been a great help! You were right. It was a Nuget issue and managed to get the package installed in my website. Tested it out with a few tests with help from your tutorial and the routing is working. So the only question I have now
is how do I get it to work by replacing ID passed in the URL data with friendly names e.g. instead of stateID state name. I am guessing it is creating some kind of lookup code in the _AppStart file. How do I go about doing that with the WebPageRouteHandler
package?
litu5277
Member
18 Points
26 Posts
What's the Best Approach for Producing SEO friendly URL's?
Nov 09, 2012 07:44 PM|LINK
So I am trying to get a site I am working on, more SEO friendly. The site has been built using the Web Page model(with Visual Web Developer Express). Now I am completely new to this, so any help would be greatly appreciated. So here is the scenario. The site has dynamically generated content specific to all 50 states in the US. Currently the URL's take the form http://www.mydomainname.com/products/{stateID} . All the stateID's and their corresponding state names are stored in a SQL Server database. What I want to achieve is have the url's take the form of http://www.mydomainname.com/products/{fullstatename}. So what is the best way to achieve this? From the little research I have done, you could(correct me if I am wrong) do this previously in ASP.NET using "URL rewriting". But I have also come across what is called "URL routing" which is apparently simpler and better. Is that the case? What is the difference between the two?
I would appreciate any help pointing me in the right direction. If possible, a step-by-step tutorial on how to produce SEO friendly URL's in the ASP.NET Web Page model would be greatly appreciated.
Thanks in advance!
Mikesdotnett...
All-Star
154818 Points
19853 Posts
Moderator
MVP
Re: What's the Best Approach for Producing SEO friendly URL's?
Nov 09, 2012 07:50 PM|LINK
You can use a package called Routing For Web Pages: http://www.mikesdotnetting.com/Article/187/More-Flexible-Routing-For-ASP.NET-Web-Pages
Beginning ASP.NET Web Pages with WebMatrix | My Site | Twitter
litu5277
Member
18 Points
26 Posts
Re: What's the Best Approach for Producing SEO friendly URL's?
Nov 09, 2012 09:06 PM|LINK
Thanks Mike. Currently giving this a shot. But currently encountering an issue trying to install the WebPageRouteHandler package. Getting an error. I am using Visual Web Developer and tried using both the console(Install-Package WebPageRouteHandler) and the Nuget Package Manager, and keep getting the following error:
Element not found. (Exception from HRESULT: 0x8002802B (TYPE_E_ELEMENTNOTFOUND))
Any ideas?
Many thanks once again!
Mikesdotnett...
All-Star
154818 Points
19853 Posts
Moderator
MVP
Re: What's the Best Approach for Producing SEO friendly URL's?
Nov 09, 2012 09:31 PM|LINK
Sounds like a bug with the Nuget integration,. Try opening your site in WebMatrix and using the built-in Package Manager to obtain it instead.
Beginning ASP.NET Web Pages with WebMatrix | My Site | Twitter
litu5277
Member
18 Points
26 Posts
Re: What's the Best Approach for Producing SEO friendly URL's?
Nov 11, 2012 08:28 PM|LINK
Thanks Mike, you have been a great help! You were right. It was a Nuget issue and managed to get the package installed in my website. Tested it out with a few tests with help from your tutorial and the routing is working. So the only question I have now is how do I get it to work by replacing ID passed in the URL data with friendly names e.g. instead of stateID state name. I am guessing it is creating some kind of lookup code in the _AppStart file. How do I go about doing that with the WebPageRouteHandler package?
litu5277
Member
18 Points
26 Posts
Re: What's the Best Approach for Producing SEO friendly URL's?
Nov 12, 2012 11:19 PM|LINK
Figured it out. Ended up creating a lookup table and adding code in the _appstart file. Thanks again Mike