views:

209

answers:

1

I've got an Asp.net site set up on GoDaddy which is using UrlRewriter.net (not to be confused with UrlRewriting.net) to enable url rewriting which seems to be working ok, though I had to set IIS to run in IIS6 mode, rather than IIS7. The problem I have is that my default document is 'virtual' so while it's possible to browse to mydomain.com/default.aspx just going to mydomain.com/ doesn't work - I presume this is because IIS is expecting default.aspx to actually exist within the root directory of the website.

Is there any way around this problem?

Edit
As requested, here is the rewrite rule from my web.config file.

<rewriter>
  <rewrite url="^(/.+(\.gif|\.png|\.jpg|\.ico|\.pdf|\.css|\.js)(\?.+)?)$" to="$1" processing="stop" />
  <unless url="~/Login.aspx|~/Page-Not-Found.aspx|~/ShowPage.aspx">
    <rewrite url="^~/(.+).aspx" to="/ShowPage.aspx?PageName=$1" />
  </unless>
</rewriter>
A: 

As a work-around to this problem, I've changed my site's home page to be called Home.aspx and created a Default.aspx page which performs a 301 redirect on page load. As a side note, I had to add the EnableTheming="false" in order to fix the following error message: Using themed css files requires a header control on the page. (e.g. <head runat="server" />).

<%@ Page Language="C#" AutoEventWireup="true" Theme="" EnableTheming="false" Inherits="System.Web.UI.Page" %>
<script runat="server">
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Status = "301 Moved Permanently";
        Response.AddHeader("Location", "http://www.popupgallery.co.uk/Home.aspx");
    }
</script>
mdresser