Friday, 23 September 2011

How to redirect in web.config

Let's say you want to redirect visitors from one subdomain to another. You can do this by putting this in your web.config for the redirected-from application:

<?xml version="1.0" encoding="UTF-8"?>
        <httpRedirect enabled="true" destination="" httpResponseStatus="Permanent" />

This is ideal for obsolete website addresses that may still be saved in favorites, or linked to on a corporate intranet, or for redirecting common mistakes, such as users entering when what they really want is