Mình vừa rồi cũng tìm mãi mới có cách hướng dẫn ở trên site nước ngoài, này post lại đây để cho bạn nào có cần tìm thì tham khảo ở đây nhé. Mình ko chuyên về asp.net
Code chuyển hướng 301
Mã:
<rewrite>
<rules>
<rule name="Canonical Host Name" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTP_HOST}" negate="true" pattern="^tenmienMoi\.vn$" />
</conditions>
<action type="Redirect" url="http://tenmienMoi.vn/{R:1}" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
Code chỉ định chuyển hướng 1 link bất kỳ
Mã:
<rewrite>
<rules>
<rule name="[RULE NAME]" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny" trackAllCaptures="false">
<add input="{HTTP_HOST}{REQUEST_URI}" pattern="domain.comews.aspx" />
<add input="{HTTP_HOST}{REQUEST_URI}" pattern="www.domain.comews.aspx" />
</conditions>
<action type="Redirect" url="http://domain.vn/tin-tuc.html" redirectType="Permanent"/>
</rule>
</rules>
</rewrite>
chèn vào web.config
View more random threads:
Pallet nhựa Long An đã trở thành một trong những lựa chọn phổ biến cho nhu cầu vận chuyển và lưu trữ hàng hóa trong nhiều ngành công nghiệp. Với đặc tính nhẹ nhàng, chắc chắn và dễ vận chuyển, các...
Thanh lý pallet nhựa Long An giá rẻ