I am using URL routing in an asp.net application similar to this article here https://web.archive.org/web/20211020111718/https://www.4guysfromrolla.com/articles/012710-1.aspx but a little different because I don’t need any dynamic URL’s they are all static.
my global.asax.cs has the following:
protected void Application_Start(object sender, EventArgs e)
{
RegisterRoutes(RouteTable.Routes);
}
void RegisterRoutes(RouteCollection routes)
{
//register route for toolbox
routes.MapPageRoute("Toolbox", "toolbox", "~/Default.aspx");
//register route for aboutus
routes.MapPageRoute("About Us", "about-us", "~/About.aspx");
//register route for talktous
routes.MapPageRoute("Talk To Us", "talk-to-us", "~/Contact.aspx");
}
This works perfectly on my local machine, however when I add this to a dev server it breaks and returns 404 error. My local host URL of http://localhost:####/toolbox works fine, but on the server I upload this to the URL of http://##.##.##.##/toolbox returns a 404 error.
Any idea what might be causing that error?
My money is on an IIS configuration on your dev server. WHat version of IIS are you running?