IIS7 HTTP Redirection

Can somebody please help me to set up a http redirect in IIS7 as every setting I try seems not give the outcome I'd like.

I have a public website setup but the software has created it as a sub-folder. So basically I'd like to permanently redirect browsers to the sub folder. E.g. If they got to http://www.mysite.com that they are permanently redirected to http://www.mysite.com/mainsite.

Can someone please confirm the correct settings?
Who is Participating?
Springy555Connect With a Mentor Commented:
What sort of errors are you getting when you try the second method?

Here is another guide that might help:
There are a few solutions you can use to achieve your redirection.

The best method would be to use the IIS7 URL ReWrite module.  Here is a guide on how you can use it:

You can also use the HTTP Redirect feature in IIS7:

You can also use plain old code.  Setup a default page for http://mysite.com called something like default.aspx.

Add the code below to this page - note you can edit the destination to any URL.  In this case you can redirect to http://mysite.com/mainsite:

<script runat="server">
private void Page_Load(object sender, System.EventArgs e)
Response.Status = "301 Moved Permanently";

Open in new window

Hi Orbsol,

Please see below link.
Just change the url to http://mysite.com/mainsite.

Hope this helps.
OrbsolAuthor Commented:
Thank you for your comprehensive reply.

Your second method was what I had been trying to use but despite trying different settings I never actually achieved what I thought was a relatively simple request.

I have downloaded the rewrite module but again cannot seem to achieve my goal. The examples they give don't quite reflect what I'm trying to achieve. Can you give me an idiots guide to the setup?

I'm sure your last suggestion will work but I would prefer one of the former solutions if I can.
OrbsolAuthor Commented:
Agh, it seems I misunderstood what the tick boxes meant. Your suggested URL put me straight, thank you.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.