Is the old-fashioned query string used for identifier?

I am curious if the legacy version is used to use the query string for id. We have webapp running on Net 2.0. When we show the details of something (maybe a product), we use the query line as follows: http://www.somesite.com/Shop/Product/Detail.aspx?ProductId=100

We use the query string for the reason that the user can save the link somewhere and return at any time later. I believe that we will use rewriting url sooner or later, but at the same time I would like to know your opinion. Thanks.Cheers, X.

+7
query-string
source share
6 answers

Nothing wrong with the query string parameters. Easy to create and understand. Many sites use trendy URLs such as "www.somesite.com/Shop/Product/white_sox_t_shirt", which is cool and friendly, but works more for us poor developers.

+2
source share

The general strategy is to use the element identifier in the URL in conjunction with some keywords describing the element. This is good from the point of view of the user, because they can easily see what the URL refers to if they save somewhere. More importantly, it is useful in terms of SEO (Search Engine Optimization), because search engines will be said to rank the given URL more highly if it contains the keywords that someone is looking for.

This approach can be seen on this very site, where the identifier after the "questions" is used to query the database, and the text is used exclusively for users and search engines.

Whether you use a direct query string or a more advanced approach that makes the identifier look like part of the folder path is up to you. This is largely a matter of personal taste.

+5
source share

Yes, it's old fashioned!

However, if you are thinking of changing it to a RESTful implementation, as others have suggested, then you should continue to maintain the old URLs and request addresses, implementing HTTP 301 redirection to forward from request URLs to the new restful URL mode. This ensures that all users of old links and bookmarks will continue to work, telling search engine bots that the URL has changed.

Since your post is tagged as ASP.Net, there is a good entry on how you can support both options using the new ASP.Net routing mechanism here: http://msdn.microsoft.com/en-us/magazine/dd347546.aspx

+4
source share

Using query strings is not deprecated at all, it just needs to be used in the right places. However, never put anything in the query string, which could be a security issue, and remember that everything you read from the query string could be changed, so you should check all the data you entered.

+3
source share

It is not deprecated, but the alternative is the alternative - it is more RESTful approach:

yourwebsite.com/products/100/usb-coffee-maker

The reason is that a) search engines usually ignore any URL with a QueryString (so the page product.aspx? Id = 100 can never be indexed) and b) having a name in the URL for display purposes only supposedly helps SEO as well.

+1
source share

Permanent links are best suited for SEO, and also, what if your product has moved to a different database and the product ID needs to be changed?
I do not think that the chances of a product name will be changed either by the manufacturer. For example, Apple / Iphone will not change :) It seems to me good.

0
source share

All Articles