1

I have just publish my ASP.Net MVC application online .. but all the actions and controllers work fine for registered users.

only one of them return 403 .. ?

locally everything works perfectly.

Any debugging suggestion will be very helpful.. any ideas as well

I know its something with the routing engine .. as the direct url : /UserPortal/Portal/Portal works well = Area, = Controller, = Action

But when i use: /UserPortal/ It returns 403 ..

i have the following in my UserPortalAreaRegistration.cs

public override void RegisterArea(AreaRegistrationContext context) 
        {
            context.MapRoute(
                "UserPortal_default",
                "UserPortal",
                new { controller = "Portal", action = "Portal", id = UrlParameter.Optional }
            );

            context.MapRoute(
                "UserPortal_standard",
                "UserPortal/{controller}/{action}/{id}",
                new { action = "Index", id = UrlParameter.Optional }
            );
        }
Mortalus
  • 10,574
  • 11
  • 67
  • 117
  • Can you provide an code sample? – Jeffrey A. Gochin Jun 07 '15 at 06:16
  • A few possible solutions [here](http://stackoverflow.com/questions/11043168/403-forbidden-after-publishing-asp-net-mvc) –  Jun 07 '15 at 06:38
  • Yeah this i already know .. And applied . thus is why the rest of the app is working .. Only the default rute to the user portal return 403.. Something is very wrong there :/ – Mortalus Jun 07 '15 at 08:57

1 Answers1

0

It can be route template issue. Your first route's template is "UserPortal", but your url is "UserPortal/". So first route isn't matched. Try removing slash and see if it works. Also I suggest you to completely remove first route and add defaults to second one:

new { controller = "Portal", action = "Index", id = UrlParameter.Optional }
ranquild
  • 1,799
  • 1
  • 16
  • 25