I have found this bit of web.config code for checking the url to see if its missing the www. if it is then it redirects the user to the www. url
<rewrite>
<rules>
<clear />
<rule name="WWW Rewrite" enabled="true">
<match url="(.*)" />
<conditions>
<add input="{HTTP_HOST}" negate="true" pattern="^www\.([.a-zA-Z0-9]+)$" />
</conditions>
<action type="Redirect" url="http://www.{HTTP_HOST}/{R:0}" appendQueryString="true" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
however i need to do the opposite and i have been hacking around with it (im not very good with regular expressions, no matter how much i try) to try and get it to see if the url has www then redirect it to the non www
reason being is i have a subdomain
trade.words.co.uk
but i want to make sure they dont go to http://www.trade.words.co.uk
Thanks for any help in advance
Try this: