IIS7 HTTP Redirection

Posted on 2009-12-16
Last Modified: 2012-08-14
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 that they are permanently redirected to

Can someone please confirm the correct settings?
Question by:Orbsol
    LVL 13

    Expert Comment

    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 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

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

    Open in new window

    LVL 7

    Expert Comment

    Hi Orbsol,

    Please see below link.
    Just change the url to

    Hope this helps.
    LVL 3

    Author Comment

    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.
    LVL 13

    Accepted Solution

    What sort of errors are you getting when you try the second method?

    Here is another guide that might help:
    LVL 3

    Author Comment

    Agh, it seems I misunderstood what the tick boxes meant. Your suggested URL put me straight, thank you.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Running classic asp applications under Windows Server 2008 R2 (x64) and IIS 7 is not as easy as one may think. It took me a while to figure it out while getting error 8002801d a few times. After you install the OS you will need to install the fol…
    A Change in PHP Behavior with Session Write Short Circuit ( (Winter 2014)** With the release of PHP 5.6 the session handler changed in a way that many think should be considered a bug.  See the note …
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now