开发者

404 when changing .NET website from one domain to another

开发者 https://www.devze.com 2023-02-13 07:47 出处:网络
I have a website project built by someone else created in VS 2008. It has a MSSQL database attached. I\'ve got it running fine on our development domain and locally. But when I try to copy the files t

I have a website project built by someone else created in VS 2008. It has a MSSQL database attached. I've got it running fine on our development domain and locally. But when I try to copy the files to the domain I want to use to host the site I get 404 errors on all of the pages apart form the default.aspx.

The nav for the pages is in the masterpage.master.cs and there is a URL rewrite by the look of it.

I thoug开发者_运维百科ht it may be a web.config problem. I'm sure its something simple.

any help appreciated

cheers

Jerome


This is the rewiter code

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

This is code from 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",
        }
    }
};
0

精彩评论

暂无评论...
验证码 换一张
取 消