简体   繁体   English

IIS 7.5自定义错误和URL重写

[英]IIS 7.5 Custom Errors and URL Rewrite

I was looking at both of these options in IIS to try and accomplish the compounding of querystrings to appear like file directories.. like this: 我在IIS中查看了这两个选项,以尝试完成查询字符串的混合,使其看起来像文件目录。

/search/

/search/janice

/search/janice/cooper

Whereas the original URL is something like /search?fname=janice&lname=cooper 原始URL类似于/search?fname=janice&lname=cooper

I tried the URL Rewrite method, but it doesn't allow optional fields (for querystrings) 我尝试了URL Rewrite方法,但是它不允许使用可选字段(用于查询字符串)

I tried custom 404 error, and it gets the REFERER of the original script, but the script itself cannot accessed by URL, only be referral, so this won't work either.. 我尝试了自定义404错误,它获取了原始脚本的REFERER,但脚本本身无法通过URL访问,只能通过引用进行访问,因此也无法使用。

Does anyone have any suggestions on how to accomplish something like this? 有人对如何完成这样的事情有任何建议吗?

Here is one method to achieve it: URL Rewriting in classic ASP 这是一种实现它的方法: 经典ASP中的URL重写

The best way to achieve the concatenating of query strings to end up as URL routing is to upgrae the project to be ASP.Net and use ASP.NET Routing . 实现查询字符串的连接并最终作为URL路由的最佳方法是将项目升级为ASP.Net并使用ASP.NET Routing

If you are in the middle of upgrading and wish to be able to switch over easily without broken links and losing google ranking when links change is to use Helicon ISAPI Rewrite 如果您正处于升级过程中,并且希望能够轻松切换而不会断开链接,并且在更改链接时不会失去Google排名,请使用Helicon ISAPI Rewrite

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM