I have the url: https://www.abc.com/category.aspx?name=value
I want to hide the name just show value this url become: https://www.abc.com/category.aspx/value
how can I do that?
How about using the URL Rewrite Module?
Well, if you turn on friendly urls, then your path name would become this:
So, I quite much always use friendly url's, and thus my users never see/have ".aspx" in any page on the site.
And, this also means that URL's become search engine friendly, or say allow users to copy + share a link with greater ease.
And, if you can make the assumption that the paramter "name" is the ONLY pramter you ever use?
then your URL could become this:
Or maybe you want this:
and parameters you add are done with "/" - that replaces the ?SomePName=SomeValue
You can install friendly URL's via a nuget package.
HOWEVER, make sure you have (make) a copy of the site, or say use GIT so you can roll this back if you don't like the results.
Do note the above assumes that you want to have the "ID" or whatever in the URL.
However, I often don't want (or like) having some "id=234" in the URL. this can be a security issue, and often makes the URL look poor anyway.
So, from one page to the next, I tend to use session() to pass the value, and thus the value(s) are only exposed in code behind. Eihter way, adopting friendly URL's does clean up and make your URL's look rather nice.
A good example of friendly URL's in action? Take a look at the URL of this page!
6 people are following this question.