Advice on "Friendly Urls"
-
Hiya all. I'm about to do a new website where I need to use "friendly urls" (which I think the term is), but as I've read more about the topic, I've gotten to say the least, a bit confused about which avenue to explore most. What I'd like to end up with is that when the user enters for instance: www.domain.com/products/productnumber.aspx that I'll then subtract the productnumber and handle it internally as if the user had typed: www.domain.com/default.aspx?pageid=xxx&productid=yyy. (Naturally can be other types of urls, but the situation is the same) As I understand it there seems to currently be two ways of creating these friendly urls. 1) Use HttpContext.RewriteUrl("new url") in the application.beginrequest in global.asax 2) Use/trap 404 errors on a custom page I am unsure which of these two methods are the best and what the pros and cons on each of them are. I haven't found many ressources which mentions both and when I do it is often in comments and not an comparison of these. Any advice on which of the two methods to use, or possible ressources pointing to a comparison, or perhaps even a third way? With regards, and thanks in advance. --------------------------- 127.0.0.1 - Sweet 127.0.0.1
-
Hiya all. I'm about to do a new website where I need to use "friendly urls" (which I think the term is), but as I've read more about the topic, I've gotten to say the least, a bit confused about which avenue to explore most. What I'd like to end up with is that when the user enters for instance: www.domain.com/products/productnumber.aspx that I'll then subtract the productnumber and handle it internally as if the user had typed: www.domain.com/default.aspx?pageid=xxx&productid=yyy. (Naturally can be other types of urls, but the situation is the same) As I understand it there seems to currently be two ways of creating these friendly urls. 1) Use HttpContext.RewriteUrl("new url") in the application.beginrequest in global.asax 2) Use/trap 404 errors on a custom page I am unsure which of these two methods are the best and what the pros and cons on each of them are. I haven't found many ressources which mentions both and when I do it is often in comments and not an comparison of these. Any advice on which of the two methods to use, or possible ressources pointing to a comparison, or perhaps even a third way? With regards, and thanks in advance. --------------------------- 127.0.0.1 - Sweet 127.0.0.1