开发者

ASP redirect URL

I want to create redirection rules in .asp files.

For e.g. when I type w开发者_如何转开发ww.example.com/states/ABC/XYZ

It should run www.example.com/states?state=ABC&city=XYZ page and browser address should display www.example.com/states/ABC/XYZ.

I know how to use .htaccess file in ColdFusion, but no idea how redirect thing works in classic ASP.


you can use server.transfer. It keeps the url the same (there is no actual browser redirect, it's all server-side)

hmm... on second thought, I sort of remember you not being able to use parameters in classic ASP when using server.transfer


Depends on the server version you are using. If you are on IIS7 or above, you can use the URL rewriting module (you may have to install it with Web Platform Installer).

If you are on IIS6 or below, you will need a 3rd party tool. I can recommend ISAPI_Rewrite personally, v3 even supports .htaccess syntax. V2 has a free version which is a single config for the whole server, and the paid for versions are good value.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜