500 Error

Naresh Ede asked on April 9, 2019 14:33

Hi All,

We have a URL, www.demo.com/articles/list/aritcle1

This is working fine.

When we are trying to replace the 'list' in url with space like www.demo.com/articles/ /aritcle1, It is results a yellow page "runtime error" Image Text

It is showing the 500 status code in network tab for the request. So we added the custom error in web.config

<customErrors mode="RemoteOnly">
  <error statusCode="500" redirect="~/500Error.aspx" />
</customErrors>

Still it is redirecting to yellow page.

Here my main intention is handling 500 errors and redirecting it to custom error page.

Need help on this.

Thanks,

Naresh Ede.

Recent Answers


David te Kloese answered on April 9, 2019 14:55

Are you testing this from a different pc the site is hosted on? As the "mode='RemoteOnly'" will only be served when called from remote location

0 votesVote for this answer Mark as a Correct answer

David te Kloese answered on April 9, 2019 14:59

Ah I now see the error. Does the 500 page actually exists?

As the error states:

An exception occurred while processing your request. Additionally, another exception occurred while executing the custom error page

Can you reproduce it locally, as that could show you the exact error.

0 votesVote for this answer Mark as a Correct answer

Naresh Ede answered on April 9, 2019 16:56

Hi David,

I had changed it from "RemoteOnly" to "On".

Still getting the same error.

And Yes there exists a page to redirect for 500 error.

0 votesVote for this answer Mark as a Correct answer

Development Support Avastonetech answered on April 9, 2019 21:23 (last edited on April 9, 2019 21:24)

0 votesVote for this answer Mark as a Correct answer

Trevor Fayas answered on April 9, 2019 21:24

Naresh, I am trying to recall what i had to do to fix this issue, a big one was i was accidently upgrading with the Beta of Kentico 12 (probably not your problem). Make sure these things are set properly as they are hard to debug and may be linked:

  1. Make sure both CMS and MVC site has same Security Hash value in the AppKeys
  2. Make sure you have Kentico's Routes set as the first thing

Aside from this, if you are trying to just allow the 2nd value to be an empty space, it may be that you need the route for Articles to have it's Action as optional with a default? Can you include the Route for the Articles?

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.