如何在IIS7中将“www.example1.com”和“www.example2.com”和“example2.com”重定向到“example1.com”(How to URL Redirect

编程入门 行业动态 更新时间:2024-10-22 20:36:07
如何在IIS7中将“www.example1.com”和“www.example2.com”和“example2.com”重定向到“example1.com”(How to URL Redirect “www.example1.com” & “www.example2.com” & “example2.com” to “example1.com” in IIS7)

我们在URL中将4个URL重定向到单个URL时遇到问题。

以下是我们需要的映射。

输入的网址 - >目标网址 example1.com - > example1.com www.example1.com - > example1.com example2.com - > example1.com www.example2.com - > example1.com

我们在WIn Srv 2008 SP1上使用IIS7。

我们现在已经在IIS中设置了所有绑定。 我们有HTTPS。 但是对于目标URL选项,我们拥有有效的证书。 所有其他选项都显示为“此连接不受信任”,用户必须手动单击“继续浏览”网站。 我们希望将用户重定向到所需的站点,即使用户键入任何URL也是如此。 我的意思是浏览器中用户的URL应该更改为目标URL,并且应该打开安全连接。

我在google搜索后找到了URL Redirect 2.0。 这会解决我的问题。 它是安全的还是有任何问题涉及到这一点。

没有安装任何更好的选择。

TIA

Arun Kumar Allu。

We are facing problems in URL Redirecting 4 URL's to a single URL.

The following is the mapping we need.

Entered URL -> Target URL example1.com -> example1.com www.example1.com -> example1.com example2.com -> example1.com www.example2.com -> example1.com

We are using IIS7 on WIn Srv 2008 SP1.

We now have all the bindings set in IIS. We have HTTPS. But for only the Target URL option we are having a valid certificate. All the rest of the options are shown as "This Connection is Untrusted" and the user has to manually click on the proceed to website. We want to redirect the user to the desired site even if the user types any of the URL's. I mean the User's URL in the browser should change to the target URL and the secured connection should open.

I have found URL Redirect 2.0 after googling for this. Will this solve my problem. Is it safe or is there any gotcha's involved in this.

Any better option without installing any.

TIA

Arun Kumar Allu.

最满意答案

我假设你安装了IIS“URL Rewrite”模块,如果是这样,那么使用这些重写规则:

<rule name="AllToExample1Http" stopProcessing="true"> <match url="(.*)" /> <conditions> <add input="{HTTP_HOST}" pattern="^www\.example1\.com$|^example2\.com$|^www\.example2\.com$" /> <add input="{HTTPS}" pattern="^OFF$" /> </conditions> <action type="Redirect" url="http://example1.com/{R:1}" /> </rule> <rule name="AllToExample1Https" stopProcessing="true"> <match url="(.*)" /> <conditions> <add input="{HTTP_HOST}" pattern="^www\.example1\.com$|^example2\.com$|^www\.example2\.com$" /> <add input="{HTTPS}" pattern="^ON$" /> </conditions> <action type="Redirect" url="https://example1.com/{R:1}" /> </rule>

I assume you have IIS "URL Rewrite" module installed, if so, then use these rewrite rules:

<rule name="AllToExample1Http" stopProcessing="true"> <match url="(.*)" /> <conditions> <add input="{HTTP_HOST}" pattern="^www\.example1\.com$|^example2\.com$|^www\.example2\.com$" /> <add input="{HTTPS}" pattern="^OFF$" /> </conditions> <action type="Redirect" url="http://example1.com/{R:1}" /> </rule> <rule name="AllToExample1Https" stopProcessing="true"> <match url="(.*)" /> <conditions> <add input="{HTTP_HOST}" pattern="^www\.example1\.com$|^example2\.com$|^www\.example2\.com$" /> <add input="{HTTPS}" pattern="^ON$" /> </conditions> <action type="Redirect" url="https://example1.com/{R:1}" /> </rule>

更多推荐

URL,We,用户,目标,IIS,电脑培训,计算机培训,IT培训"/> <meta name="description&

本文发布于:2023-07-26 15:45:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1277523.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:中将   重定向   如何在   www   URL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!