I just want my MVC5 Site hosted on godaddy to handle the sitemap.xml file. (mysite.com/sitemap.xml) .
I've seen and followed this post: MVC: How to route /sitemap.xml to an ActionResult?
- Added Handler on Web.Config
<add name="HtmlFileHandler" path="*.html" verb="GET" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
I added a route for my sitemap.xml file:
routes.MapRoute( name: "Sitemap", url: "sitemap.xml", defaults: new { controller = "Home", action = "SiteMap", id = UrlParameter.Optional } );
Added the corresponding View and it's controller 3.1 (SiteMap.cshtml on \Views\Home) with some xml contento 3.2 A Home Controller for that:
public ActionResult SiteMap() { return View(); }
(with just sample xml text)
While running Visual Studio, I can see the localhost:xxxx/sitemap.xml mapping.
I upload it to Godaddy, and then I just get a 404 error (accesing mysite.com/sitemap.xml)
Any clue? Any step I'm missing?
Thanks for your help.
PnP