重定向到服务器 [英] Redirect to server

查看:70
本文介绍了重定向到服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我需要将URL重定向到另一台服务器,如何访问该服务器并将其包含在我的代码中,以便response.redirect可以识别它?
目前,我正在使用位于主机文件中不同服务器上的主机名IP来访问它,但这就是本地主机.
有什么方法可以重定向到此服务器?

关于

Hi All,
I need to redirect URL to another server, how can i access the server and include it in my code so that response.redirect recognizes it?
At the moment i am using host name IP sitting on the different server in my host file to access it, but thats on local.
Is there a way that i could redirect to this server?

Regards

推荐答案

,您可以使用Server.Transfer. CP不让我说更多,但这真的很简单.

您还应该考虑正确标记问题.显然这是一个ASP.NET问题.
you can use Server.Transfer. CP won''t let me post without saying more, but it''s really that simple.

You should also consider tagging your questions properly. This is plainly an ASP.NET question.


我将如何访问该服务器,假设您要重定向到google.co.uk,您将如何处理?
How would i access that server, let say you want to redirect to google.co.uk, how would you do that?


您的问题不清楚

您可以使用Response.Redirect(url) Server.Transfer(url).您无需访问要重定向/转移到的服务器.请理解<a href="http://msdn.microsoft.com/en-us/library/a8wa7sdt(v=vs.80).aspx">redirect</a>[<a href="http://msdn.microsoft.com/en-us/library/a8wa7sdt(v=vs.80).aspx" target="_blank" title="New Window">^</a>] <a href="http://msdn.microsoft.com/en-us/library/system.web.httpserverutility.transfer.aspx">transfer</a>[<a href="http://msdn.microsoft.com/en-us/library/system.web.httpserverutility.transfer.aspx" target="_blank" title="New Window">^</a>]之间是有区别的.
Your question is not clear

you can use Response.Redirect(url) or Server.Transfer(url). You don''t need to access the server you are redirecting/transferring to. Please understand that there is a difference between <a href="http://msdn.microsoft.com/en-us/library/a8wa7sdt(v=vs.80).aspx">redirect</a>[<a href="http://msdn.microsoft.com/en-us/library/a8wa7sdt(v=vs.80).aspx" target="_blank" title="New Window">^</a>] and <a href="http://msdn.microsoft.com/en-us/library/system.web.httpserverutility.transfer.aspx">transfer</a>[<a href="http://msdn.microsoft.com/en-us/library/system.web.httpserverutility.transfer.aspx" target="_blank" title="New Window">^</a>].


这篇关于重定向到服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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