如何从一个网站重定向iis web服务器中的另一个网站 [英] how to redirect from one web site another web site in iis web server

查看:63
本文介绍了如何从一个网站重定向iis web服务器中的另一个网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我用网站和管理站点实现了MVC3应用程序。

并为网站和管理员分配了127.0.0.1的ip地址现场。在C:\ Windows \ System32 \ drivers \ etc \ host文件

我的网站网址是web.mywebsite.local

我的管理网站网址是admin.myadminsite.local

但是当我尝试从网站重定向到管理站点时我得到以下网址格式

http://web.mywebsite.local/? ReturnUrl = http://admin.myadminsite.local



请给我打电话帮我解决问题



谢谢你

解决方案

在以下情况下,重定向很有用:



1.你改变了您的网站的位置,并希望将用户重定向到您的新网站。



2.您的网站正在建设中,您希望该网站的一部分不可用。



3.您的内容不在Web服务器上。



4.您已更改了虚拟目录的名称,您希望用户能够从旧URL访问文件。


在最简单的配置中,您只需要设置< httpredirect>的启用和目标属性。元素,以便将客户端重定向到新位置。但是,其他元素(如exactDestination和httpResponseStatus属性)允许您通过分别指定IIS 7是否将返回完全按照输入的目标URL以及返回到Web客户端的HTTP响应代码来配置重定向的最终用户体验。

Hi
I am implemented the MVC3 application with website and adminsite.
and am assigned the 127.0.0.1 ip address to both web site and admin site. in C:\Windows\System32\drivers\etc\host file
my web site url is web.mywebsite.local
my admin site url is admin.myadminsite.local
but when am trying to redirect from web site to admin site am getting the following url pattern
http://web.mywebsite.local/?ReturnUrl=http://admin.myadminsite.local

please tel me help me to solve the problem

thank u

解决方案

Redirection is helpful in the following situations:

1. You change the location of your Web site and want to redirect users to your new site.

2. Your Web site is under construction and you want part of the site to be unavailable.

3. Your content is not located on the Web server.

4. You have changed the name of a virtual directory and you want users to be able to access files from the old URL.

In the simplest configuration, you need only set the enabled and destination attributes of the <httpredirect> element in order to redirect clients to a new location. However, additional elements like the exactDestination and httpResponseStatus attributes allow you to configure the end-user experience of the redirection by respectively specifying whether IIS 7 will return the destination URL exactly as entered and which HTTP response code to return to the Web client.


这篇关于如何从一个网站重定向iis web服务器中的另一个网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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