redirecting directory to a page

Discussion in 'ASP.NET 2.0' started by conrads, Aug 28, 2015.

  1. Thanks to assistance from the board here, I got the private page figured out.

    But my client sends the directory without the trailing slash "http://domainname.com/intranet" as the link in his printed copy. Now he wants that to redirect to the actual staff page which is "http://domainname.com/intranet/staff.html"

    I used .htaccess but found out that I need to use web.config instead because it's IIS and not Unix. So is it possible to redirect a request to a directory to a file inside that directory? I tried the following code but I think I created an infinite loop. This web.config is in the root, http://domainname.com/


    <configuration>

    <location path="intranet">
    <system.webServer>
    <httpRedirect enabled="true" destination="http://domainname.com/intranet/staff.html" httpResponseStatus="Permanent" />
    </system.webServer>
    </location>

    </configuration>
     
  2. RayH

    RayH DiscountASP.NET Lackey DiscountASP.NET Staff

  3. Thanks! I'll take a look at those and see if I can fix it.
     
  4. Well, that was overkill.

    Didn't need to redirect it all. Just rename the target html file to index.html and that part is sorted. o_O

    Unfortunately, now the page renders while the User and Password dialog pops up. :confused:
     
    RayH likes this.
  5. RayH

    RayH DiscountASP.NET Lackey DiscountASP.NET Staff

    That works too. :)
     

Share This Page