Simple IIS 301 redirects
One of the common requests I get is to setup 301 redirects when porting to a new site. There are really simple ways to do this on an Apache based server but for IIS on Microsoft platforms it's not as easy as having a .htaccess file and you need to know a few things about IIS operates in order to do this.
For example if you can redirect a directory on IIS you can do really simply by pointing the directory at a new URL. Simply right-click on the directory in IIS and select properties to be presented with the following screen:

Simply select the "Directory" tab and the "redirect to a url" option then type the url into the "Redirect to:" box. You can even pass over querystring parameters (let's say for tracking or the like) by adding $Q to the end of the URL.
For example:
If the virtual directory that is mapped to the following Web site:
http://www.mydomain.com/products
is configured to be redirected to the following exact URL:
http://www.myNEWdomain.com/products$S$Q
A new request for the following URL:
http://www.mydomain.com/products/File.asp?var1=5&var2=6
Would be redirected automatically to the following URL:
http://www.myNEWdomain.com/products/File.asp?var1=5&var2=6
For more information on what variables you can pass check out the IIS documentation at: IIS Docs
Or give us a shout at Code Required as we'd be only to glad to help!
Also check out our article about porting an ASP (classic) site to ASP.net and how you can setup 301 redirects really easily!
For example if you can redirect a directory on IIS you can do really simply by pointing the directory at a new URL. Simply right-click on the directory in IIS and select properties to be presented with the following screen:

Simply select the "Directory" tab and the "redirect to a url" option then type the url into the "Redirect to:" box. You can even pass over querystring parameters (let's say for tracking or the like) by adding $Q to the end of the URL.
For example:
If the virtual directory that is mapped to the following Web site:
http://www.mydomain.com/products
is configured to be redirected to the following exact URL:
http://www.myNEWdomain.com/products$S$Q
A new request for the following URL:
http://www.mydomain.com/products/File.asp?var1=5&var2=6
Would be redirected automatically to the following URL:
http://www.myNEWdomain.com/products/File.asp?var1=5&var2=6
For more information on what variables you can pass check out the IIS documentation at: IIS Docs
Or give us a shout at Code Required as we'd be only to glad to help!
Also check out our article about porting an ASP (classic) site to ASP.net and how you can setup 301 redirects really easily!




