0

I have an MVC project that I am trying to deploy to a hosting service that uses an IIS server. I have already FTP'd the files to the root directory, checked that my permissions are correct, and made sure the server is working. My problem is that it appears that the server is looking for a default.html page in my root directory, which does not exist, nor do I want it to exist. When i currently navigate to my website it says "You do not have permission to view this directory or page." The project runs perfectly in my local host. How do I get it to run on the server without creating a new index/default page?

Here is my RouteConfig file

public class RouteConfig
{
    public static void RegisterRoutes(RouteCollection routes)
    {
        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

        routes.MapRoute(
          name: "EmailPDF",
          url: "emailpdf",
          defaults: new { controller = "Emails", action = "SendPDFEmail",  }
          );

      routes.MapRoute(
            name: "Default",
            url: "{controller}/{action}/{id}",
            defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
        );
    }
}
Lex Li
  • 60,503
  • 9
  • 116
  • 147
  • https://stackoverflow.com/questions/973205/asp-net-mvc-default-route – Lex Li Oct 08 '18 at 19:31
  • @LexLi my map routing already looks like that. edited my post to show – Chris Gray Oct 08 '18 at 19:50
  • Really? "already looks like that"? Read carefully the routes in those answers and do your experiments. – Lex Li Oct 08 '18 at 20:05
  • I added the role: "anonymous" to the default maproute and it did not change anything. If I copy the exact code from that post, i get an error, cannot convert from type to string. – Chris Gray Oct 09 '18 at 04:31
  • Possible duplicate of [Set "Homepage" in Asp.Net MVC](https://stackoverflow.com/questions/1142003/set-homepage-in-asp-net-mvc) – Lex Li Oct 09 '18 at 12:43
  • Another existing thread, though the key points were already there in the first link. – Lex Li Oct 09 '18 at 12:44

0 Answers0