Skip to content

Instantly share code, notes, and snippets.

@pedroadaodev
Last active August 2, 2016 22:42
Show Gist options
  • Save pedroadaodev/973c9b395442b3fb53fe4fe20a42aeb6 to your computer and use it in GitHub Desktop.
Save pedroadaodev/973c9b395442b3fb53fe4fe20a42aeb6 to your computer and use it in GitHub Desktop.
Redirect all non-www to www. ex: from http://mydomain.com to http://www.mydomain.com
<!-- REDIRECT NON-WWW TO WWW -->
<add name="301ReDirect_NON-WWW_TO_WWW"
redirectMode="Permanent"
redirect="Domain"
ignoreCase="true" rewriteUrlParameter="IncludeQueryStringForRewrite"
virtualUrl="http://mydomiain.com/(.*)"
destinationUrl="http://www.mydomain.com/$1" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment