1

I have written an application in MVC4 and deployed to the server.

I am having an issue whereby when a user tries to navigate to a url that has the [Authorize] attribute locally this redirects the user to.

/Account/Login?ReturnUrl=%2fEvents%2fCreateEvent

However on the server I am finding that this is adding some extra characters to the start of the url?

/~/Account/Login?ReturnUrl=%2fEvents%2fCreateEvent

This is throwing a 404 exception due to the /~/

When the user is authenticated and navigates to Events/CreateEvent then this works correctly, however fails when they are not!

Does anyone know why?

1 Answer 1

1

Have you checked the web.config for the forms authentication setup.

Might look a bit like this.

<authentication mode="Forms">
      <forms loginUrl="~/Account/Login" timeout="2880" />
</authentication>

Try removing the tilde ~

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.