我有一个由VS 2008中创建的其他人构建的网站项目。它附带了一个MSSQL数据库。我已经在我们的开发领域和本地运行良好。但是当我尝试将文件复制到我想用来托管网站的域时,除了default.aspx之外,我在所有页面上都会出现404错误。
页面的导航是在masterpage.master.cs中,并且根据其外观重写URL。
我认为这可能是web.config问题。我确信这很简单。
任何帮助表示赞赏
欢呼声
杰罗姆
答案 0 :(得分:0)
这是重新授权代码
<rewrite url="^/home$" to="/App_Pages/default.aspx"></rewrite>
<rewrite url="^/tour$" to="/App_Pages/tour.aspx"></rewrite>
<rewrite url="^/blog(\?page=\d*)?$" to="/App_Pages/blog.aspx"></rewrite>
<rewrite url="^/blog/(\d+)/(.+)$" to="/App_Pages/blogdetails.aspx?id=$1"></rewrite>
<rewrite url="^/faqs$" to="/App_Pages/faqs.aspx"></rewrite>
<rewrite url="^/sign-in$" to="/App_Pages/sign-in.aspx"></rewrite>
<rewrite url="^/terms-and-conditions$" to="/App_Pages/terms.aspx"></rewrite>
<rewrite url="^/privacy-policy$" to="/App_Pages/privacy-policy.aspx"></rewrite>
<!-- article -->
<rewrite url="^/news/(.+)/(.+)$" to="/app_pages/news/details.aspx?id=$1"></rewrite>
<rewrite url="^/news" to="/app_pages/news/archive.aspx"></rewrite>
</rewriter>
这是来自master.cs的代码
protected Dictionary PageData = new Dictionary {
{"/default.aspx", new PageInfo
{
colour = "blue",
url = "/default.aspx?",
overrideUrl = "/",
name= "home",
}
},
{"/tour", new PageInfo
{
colour = "orange",
url = "/tour",
name = "tour",
}
},
{"/blog", new PageInfo
{
colour = "pink",
url = "/blog",
name = "blog",
}
},
{"/faqs", new PageInfo
{
colour = "green",
url = "/faqs",
name = "faq's",
}
},
{"/subscribe", new PageInfo
{
url = "http://www.thrivesolo.com/payment50.htm",
name = "subscribe",
}
}
};