开发者

IIS 301 Redirect

We have migrated our web site to new web site (don't ask why?)

In order to help us with the transition, we created 301 redirect, from the old web site to the new web site, in IIS. The redirect looks like http://www.newWebSiteApp.com$S$Q This handles all the sub directory as well as query string nicely. we tested the redirect and works great, except for https requests.

Both the new and old web sites have mixed protocol (some pages are http while other https). The redirect for https takes to http not https.

We checked IIS setting, googled, and pulled our hair with no result.

So, Is it possible to redirect http -> http and开发者_JS百科 https -> https on the same web site?


You could use IIRF to do redirects. It would be something like this:

RewriteCond   %{HTTPS} off
RewriteCond   %{HTTP_HOST}  ^www\.oldwebsite\.com$
RedirectRule  ^(.*)$        http://www.newwebsite.com$1 [R=301]

RewriteCond   %{HTTPS} on
RewriteCond   %{HTTP_HOST}  ^www\.oldwebsite\.com$
RedirectRule  ^(.*)$        https://www.newwebsite.com$1 [R=301]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜