Reputation: 183
I have to add some rules in rewrite.config for some pages that doesn't exist anymore. I added the conditions in the following patters, but they are not working:
<rule name="_Offisielt_nettsted" stopProcessing="true">
<match url="_Offisielt_nettsted$" />
<conditions>
<add input="{HTTP_HOST}" pattern="^www.example.com$" />
</conditions>
<action type="Redirect" url="https://www.example.com/" appendQueryString="false" redirectType="Permanent" />
</rule>
The initial broken url is <www.example.com/_Offisielt_nettsted> and i want to redirect to the homepage. Any ideas what I did wrong?
Upvotes: 0
Views: 58
Reputation: 3494
It sounds just like a charset issue. I just replaced the domian name. But rewrite module say <www.jokies.com> doesn't match regex expression ^www.jokies.com$.
So I rewrite the ^ and $ and it works
<rule name="_Offisielt_nettsted" stopProcessing="true">
<match url="_Offisielt_nettsted$" />
<conditions>
<add input="{HTTP_HOST}" pattern="^www.example.com$" />
</conditions>
<action type="Redirect" url="https://www.example.com/" appendQueryString="false" redirectType="Permanent" />
</rule>
Upvotes: 1