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 }
            );
        }
3
  • Can you provide an code sample? Jun 7, 2015 at 6:16
  • A few possible solutions here
    – user3559349
    Jun 7, 2015 at 6: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 7, 2015 at 8:57

1 Answer 1

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 }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.