SECØND BANANA
SECØND BANANA

Reputation: 51

IIS URL Rewrite: Redirect only the domain not the subfolders

I have a domain example.com and I just want these exact domain to be redirected to new-example.com.

All the subfolders are redirected to different domains. That works fine.

But how can I achieve the redirect of only exactly example.com ?

I have this, but I does not work.

<rule name="Redirect Rule example.com" stopProcessing="true">
    <match url="^/$" />       
    <action type="Redirect" url="https://www.new-example.com" appendQueryString="False" redirectType="Permanent" />
</rule> 

Upvotes: 0

Views: 109

Answers (1)

SEC&#216;ND BANANA
SEC&#216;ND BANANA

Reputation: 51

I think I got the error.

It needs to be

<rule name="Redirect Rule example.com" stopProcessing="true">
<match url="^$" />       
<action type="Redirect" url="https://www.new-example.com" appendQueryString="False" redirectType="Permanent" />

Upvotes: 1

Related Questions