Brett Cawley
Brett Cawley

Reputation: 57

Add Static HTML file to Root of Azure MVC App

Where do I add a static html file "mycoolpage.html" to a MVC4 project so it will be served when requesting "mysite.cloudapp.net/mycoolpage.html" when deployed to azure?

I've tried adding it to the project and setting up routes like

routes.IgnoreRoute("{resource}.html");

and tried returning it from a controller using the following route

  routes.MapRoute(
              "mycoolsite.html",
              "mycoolsite.html",
              new { controller = "Home", action = "Coolsite" }
              );

Upvotes: 3

Views: 3697

Answers (1)

Jude Fisher
Jude Fisher

Reputation: 11294

Have you tried: routes.IgnoreRoute("*.html"), with the file in the root folder of your MVC site?

(From: Getting MVC to ignore route to site root)

Upvotes: 5

Related Questions