Redirect IIS Websites Homepage with IIS 7.0

2017-12-08T14:47:53+00:00 January 7th, 2010|Azure, Cloud|

You may come across an issue from time to time.  Where you have an IIS website and when you type the URL of the IIS Site into your IE it brings up a homepage, but you would like to change the homepage for reason such as you would like to allow users to access a specific part of the site easier.

 For example

You have gave your IIS site a host header of “test” but you would like users to hit a different web page within the site when they simply type the host header in.

Currently they are hitting the below webpage when typing http://test

image

But this is not the page you want them to hit when they type in http://test we would like them to be redirected to http://test/test2 (Below Page)

image 

Resolution

To get this to work we will first have to create a htm file which redirects us to our desired site “http://test/test2

1, Open IIS Manager

2, Now expand the console until you get to your website and then switch to content view.

image

3, Right Click and press explore

image

4, Now we need to create the HTM in this location “C:Test”

5, Now open notepad and type the following in and put the url of what you want as your homepage and save it in the location we found out above and name it default.htm (Code Below was supplied by Rob http://risualblogs.com/blog/author/robb/)

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.0 Transitional//EN”>
<html>
<head>
<title></title>
<meta http-equiv=”REFRESH” content=”0;url=http://Type Your URl”></HEAD>
<BODY>
</BODY>
</HTML>

6, Now we need to make the “default.htm” the default document. So go back into the IIS Console  and switch back to Features View and double click Default Document.

image

7, Now simply press add and type in the name of the htm file and hit ok

image

8, The final thing we need to do is to move the default.htm file to the top of the default document list so it takes precedence. So simply click default.htm and press move up.

image

9, You will get a message pop up simply press yes as this is what we want to do

image

10, Now when you type in your host header URL (http://test ) you will get redirected to the correct page (http:testTest2).

Hope this Helps You 🙂