I am having a curious issue with one of my projects in development. The issue is with links to a certain URL "//localhost:62168/Images/Index". I have buttons linking to that URL but when "//localhost:62168/Images/" is accessed it returns a HTTP Error 403.14 - Forbidden error. See the below Image:
localhost//Images/
Oddly enough though, when I enter the URL exactly ("localhost:62168/Images/Index") it loads the page properly. See the below Image:
localhost/Images/Index
I've done plenty of research online and I believe it may be an issue with routing so below I've added the code of my "RouteConfig.cs" file. Unfortunately, I am new to ASP.net and MVC and not knowledgeable on proper Routing procedures:
using System.Web.Mvc;
using System.Web.Routing;
namespace ReedHampton
{
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
}
}
I've also tried multiple other "solutions" presented in other online forums to no avail. These include:
- Adding "directoryBrowse enabled="true" " to web.config
- Running "C:\windows\Microsoft.NET\Framework64\v4.0.30319> aspnet_regiis.exe -i" in Command Prompt
- Going through IIS Express and registering IIS Express and ASP.Net
I would greatly appreciate any help that anyone can provide!