I am running a small intranet site off Windows 7 and IIS and I have a page
page/LoadPage.aspx which is an ASPX container page for displaying a requested page, e.g.
http://localhost/page/LoadPage.aspx?p=downloads (which loads
downloads.html located in the root directory).
The problem is, when creating a User-Friendly URL using the URL Rewrite plugin in IIS 7, if the query tag (
p) requests a page in a particular directory (e.g.
http://localhost/page/LoadPage.aspx?p=downloads/software, which should load the page
downloads/software.html) then a 404 error will be thrown because the server thinks the user has requested a directory.
The mapping and redirecting do work for single requests like
page/LoadPage.aspx?p=downloads which successfully redirects to
UPDATE: Here is the code. Could it be the problem?
/page/LoadPage.aspx?p=downloads (This works and redirects to
/page/LoadPage.aspx?p=downloads/software (This doesn't work, but is meant to redirect to
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load Dim p = Request.QueryString("p").ToString Dim page = HttpUtility.UrlDecode(p) Dim ReadHTML As New IO.StreamReader("\\PC\User\Documents\IIS Websites\Intranet\" & page & ".html") container.InnerHtml = ReadHTML.ReadToEnd End Sub