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?
LVL 3
OrbsolAsked:
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:
http://www.trainsignaltraining.com/windows-server-2008-http-redirection/2008-03-27/
0
 
Springy555Commented:
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:
http://www.15seconds.com/issue/081205.htm


You can also use the HTTP Redirect feature in IIS7:
http://technet.microsoft.com/en-us/library/cc770409(WS.10).aspx


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";
Response.AddHeader("Location","http://mysite.com/mainsite");
}
</script>

Open in new window

0
 
poweredsCommented:
Hi Orbsol,

Please see below link.
http://www.experts-exchange.com/Software/Internet_Email/File_Sharing/HTTP/Q_24829782.html
Just change the url to http://mysite.com/mainsite.

Hope this helps.
0
 
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.
0
 
OrbsolAuthor Commented:
Agh, it seems I misunderstood what the tick boxes meant. Your suggested URL put me straight, thank you.
0
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.