在asp.net项目中重写url [英] Url-rewrite in asp.net project

查看:86
本文介绍了在asp.net项目中重写url的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试开发动态配置文件,其中.aspx页面将在注册时创建..我已经完成了创建部分..它工作正常,现在我想做的是,我希望我的页面无需扩展......就像..



i想要www.myurl.com/Profiles/sample.aspx?id=profilename就像这样www.myurl.com/profilename





其中,个人档案是文件夹,样本是个人档案中的.aspx页面。

我正在使用IIS 7,任何1可以告诉我应该怎么做才能实现这一目标?谢谢你

i'm trying to develop dynamic profiles in which, the .aspx page will be created on signup.. i've already done the creating part.. and it is working fine, Now what i want to do is, i want my pages to be extensionless... like..

i want www.myurl.com/Profiles/sample.aspx?id=profilename to be like this www.myurl.com/profilename


where Profiles is folder and sample is an .aspx page residing in Profiles.
i'm using IIS 7, can any 1 tell me what should i do to achieve this? Thank U

推荐答案

看看这个 [< a href =http://www.hanselman.com/blog/RedirectingASPNETLegacyURLsToExtensionlessWithTheIISRewriteModule.aspx\"target =_ blank> ^ ]或这个 [ ^ ]可以帮助您入门。





我会在这里提供相关信息,但它处理重写模块,webconfig或正则表达式以及两个链接都很漂亮短。我希望,尽管这可能不是一体化的解决方案,但它会为您提供移动所需的一切。
See if this[^] or this[^] can get you started.


I would put relevant info here, but its dealing with the rewrite module, the webconfig, or regex and both the links are pretty short. I hope that, even though this probably isn't the "all in one" solution for you, it will give you what you need to get moving.


这篇关于在asp.net项目中重写url的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆