I am running my website on ASP.NET and MVC.
Here, I have setup my files as .html file and these gets routed to their respective Controller/actions accordingly.
Now for verification of my site on google search console, I have to keep an .html file on my server. But on running the file, and it being a .html file, my routing is trying to map to a Controller action and so is giving a 500 error.
Thus I want to ignore the routes for any of .html file with name starts with “google*.html” like for example googlee45tdhfty.html.
Please advice, how to route it. Also if I can add the ignore option on my web.config file?
Thanks in advanced.
So far I have tried
routes.Ignore("{*google}", new { google= @"google*.html" });
Also tried
routes.IgnoreRoute("{*google}", new { google= @"(.*/)?google.*.html(/.*)" });
and then
routes.MapPageRoute(“”, “google/”, “~/google*.html”);
But none of them worked. At local it just shows 500 error and debugging also could not catch the error.