English 中文(简体)
• 如何读书写,如原样3.5
原标题:How to read rewritten url in asp.net 3.5

如何读写。 如果我在回写时不使用.。 RawUrl没有工作。 它正在归还原来的URL。

请建议您是否有解决办法。 我正在使用Ionics Isapi Rewrite Filter(IIRF)。

例如,如果我改写:

http://<mywebsite>/users.aspx?id=12&name=amitava

纽约总部

http://<mywebsite>/profile/12/amitava

Now in the same page, at some point, I want 纽约总部 get this rewrittern url f或 the purpose of pointing return url in login link. Now a login link should be:

http://<mywebsite>/login.aspx?ReturnUrl=/profile/12/amitava

http://<mywebsite>/login.aspx?ReturnUrl=http://<mywebsite>/profile/12/amitava

What is the proper way 纽约总部 achieve this? Thanks.

最佳回答

对国际投资论坛来说,这称为ungling,并且可以通过使用模拟<代码>来实现。 U 。

http://cheeso. members.winisp.net/Iirf21Help/html/bdaf0dbe-e539-4bf5-9231-1dae3b0e27a5.htm#Modifiers”rel=“nofollow noreferer”IIRF Manual :

U = Store original url in server variable HTTP_X_REWRITE_URL

简言之,在<代码>上添加以下案文: 例如:

RewriteRule ^yourexpression$ yourrewrittenurl [I,U,L] 

接着,在你的网页上,你可以照此办理:

Request.ServerVariables("HTTP_X_REWRITE_URL")

另见我的answer here

问题回答

Are you using the IIS rewriting module? If you are then HttpContext.Current.Request.RawUrl should give you the rewritten URL and HttpContext.Current.Request.Url.OriginalString should give you the non-rewritting URL.





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签