I have a rewrite rule in my MVC project to rewrite URL of any HTTP request to HTTPS:
<rewrite>
<rules>
<rule name="Redirect HTTP to HTTPS" enabled="true" patternSyntax="Wildcard" stopProcessing="true">
<match url="*" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTPS}" pattern="off" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Found" />
</rule>
</rules>
</rewrite>
But now I need to redirect all the requests from the original www.company.com to a new url www2.company.com
How can I do that to keep also the original HTTP to HTTPS?
Any Google Analytics change for this new redirect operation?
EDIT:
Examples:
http://old.company.com -> https://new.company.com
https://old.company.com -> https://new.company.com
http://www.old.company.com -> https://new.company.com
https://www.old.company-com -> https://new.company.com
http://old.company.com/Account/Login -> https://new.company.com/Account/Login
https://old.company.com/Account/Login -> https://new.company.com/Account/Login