开发者

How can you pass URL Parameters at URL slashed address? (www.example.com/1/2 = www.example.com?x=1&y=2)

开发者 https://www.devze.com 2022-12-28 00:09 出处:网络
I want to be able to take a url and map it to a set of web parameters. For example: www.example.com/1/2/3 would be interpreted as www.example.com开发者_开发问答/default.asp?x=1&y=2&z=3

I want to be able to take a url and map it to a set of web parameters. For example:

www.example.com/1/2/3 would be interpreted as www.example.com开发者_开发问答/default.asp?x=1&y=2&z=3

I know I've seen it done, I just can't find it anymore. Any ideas?


Try http://www.iis.net/download/URLRewrite


With CGI, look for the PATH_INFO environment variable. Note that when you're handling an image map, the coordinates of a click are always sent via the QUERY_STRING (or the POSTed equivalent).


This may require asp.net. One solution is to handle all your requests in the global.asax. Generally using URL rewriting is better than this (it's already written and designed to do this), though this gives you more control. This may also require the use of a 404 redirector in order to ensure that the urls are routed to asp.

0

精彩评论

暂无评论...
验证码 换一张
取 消