Domanda

We have a web project which we are working on (Custom CMS). Have a url example http://www.test.com/page.asp?PID=191

Is there not an way to change this url into something like http://www.test.com/product-title/

Any help would greatly be appreciated.

È stato utile?

Soluzione

An old method of doing this was to use custom error handling. Using a 404 custom error handling page you can trap a request to http://www.test.com/product-title/ pull it apart and build the request to the resource in this case http://www.test.com/page.asp?PID=191.

There are various ways of doing this from storing the values in a database so you can lookup your friendly address against it's equivalent to using the URL to describe the resource, something like http://www.test.com/products/191/ then using this as the basis of your rewrite.

In newer versions of IIS though (7 and above) you can use the URL Rewriting to build translation from one URL to another on the fly.

Links

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top