views:

218

answers:

1

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 https -> https on the same web site?

+1  A: 

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]
Mauricio Scheffer
Mauricio,Thanks for the idea. I am not familiar with IIRF. I will look at it. From quick glimpse, it seems interesting.Again thank you,Yusuf
Yusuf