Mam następującą regułę przepisywania, aby przekierować dowolny conetnt z hosta hostA.com na stronę główną nowego hosta hostB.com. Chcę także zmienić adres URL przeglądarki na www.HostB.com
<rewrite>
<rules>
<rule name="301 redirect entire site" stopProcessing="true">
<match url="^hostA(.*)$" />
<action type="Redirect" redirectType="Permanent" url="http://www.hostB.com" appendQueryString="true" />
</rule>
</rules>
</rewrite>
Ale to nie działa. Jak mogę to naprawić?
Odpowiedzi:
1 dla odpowiedzi № 1możesz tak zrobić
<rule name="domain redirect" enabled="true" stopProcessing="true">
<match url="^hostA(.*)$" />
<action type="Redirect" url="http://hostb.example.com/{R:0}" appendQueryString="true" />
</rule>