Page Not Found

Ger Vang asked on January 5, 2015 18:42

I’m not sure when this behavior changed but ever since our company updated from version 6 SP1 to 7.0.84 we are getting a different behavior for ‘Page Not Found’. For example, if a user type in “members-dev.nvthbs.local/test.aspx” they should be redirect to “members-dev.nvthbs.local/en-US/General/pagenotfound.aspx?aspxerrorpath=/test.aspx”.

For some reason now when a user type in the same URL “members-dev.nvthbs.local/test.aspx”, the URL doesn’t redirect to “members-dev.nvthbs.local/en-US/General/pagenotfound.aspx?aspxerrorpath=/test.aspx”. Is there a way so we can redirect to the page not found?

Recent Answers


Eric Garrison answered on January 6, 2015 04:14

This is likely an issue in your web.config. See if you have this:

0 votesVote for this answer Mark as a Correct answer

Sandro Jankovic answered on January 6, 2015 10:45

Hello,

Would it be possible to review your settings and ensure they are configured as per the documentation? If they are but this is still not working as expected please get back to us.

Best Regards,

Sandro

0 votesVote for this answer Mark as a Correct answer

Ger Vang answered on January 6, 2015 15:45

I have this setup already. It’s showing my “Page Not Found” page but the URL is not changing. I want my URL to actually go to “members-dev.nvthbs.local/en-US/General/pagenotfound.aspx?aspxerrorpath=/test.aspx” instead of staying at the URL I typed.

Here's the Page Not Found

Image Text

Here's the Kentico Setting

Image Text

Here's the web.config:

Image Text

I don’t want the URL to be like this:

Image Text

I want the URL to be like this (noticed that the menu on the left is showing now):

Image Text

0 votesVote for this answer Mark as a Correct answer

Ger Vang answered on January 6, 2015 16:04

Not sure why my other post images doesn't work.

I have this setup already. It’s showing my “Page Not Found” page but the URL is not changing. I want my URL to actually go to “members-dev.nvthbs.local/en-US/General/pagenotfound.aspx?aspxerrorpath=/test.aspx” instead of staying at the URL I typed.

Here's the Page Not Found

Image Text

Here's the Kentico Setting

Image Text

Here's the web.config:

Image Text

I don’t want the URL to be like this:

Image Text

I want the URL to be like this (noticed that the menu on the left is showing now):

Image Text

0 votesVote for this answer Mark as a Correct answer

Martin Danko answered on January 6, 2015 16:15

The reason why images doesn't work is that they are not accessible for public... simply try to access it from another browser where you are not logged-in or anonymous window:

https://doc-08-cc-docs.googleusercontent.com/docs/securesc/r32mqgrdobgj3dr3kdd5d9vu8bs01bns/micm0dsijnk15gd6bjk664l5artct8qg/1420552800000/01395291426777129402/07872524403423615719/0BykS_DxIz0bLV2RJZjJkdVFyTG8?e=view

0 votesVote for this answer Mark as a Correct answer

Ger Vang answered on January 6, 2015 20:35

Sorry, for the third time. Since I don't have a place to host my images, I'll just link it here.

I have this setup already. It’s showing my “Page Not Found” page but the URL is not changing. I want my URL to actually go to “members-dev.nvthbs.local/en-US/General/pagenotfound.aspx?aspxerrorpath=/test.aspx” instead of staying at the URL I typed.

Here's the Page Not Found

Here's the Kentico Setting

Here's the web.config

I don’t want the URL to be like this

I want the URL to be like this (noticed that the menu on the left is showing now)

0 votesVote for this answer Mark as a Correct answer

Eric Garrison answered on January 6, 2015 23:05

I see you do have the web.config entry that I was expecting. The only thing that I see different from my test server is you have ~/general - mine is just /general.

Only other thing to check. The make sure you don't have a custom 404 error in the web.config. For many things like robots.txt, if you have it in the file system, it overrides the CMS.

0 votesVote for this answer Mark as a Correct answer

Ger Vang answered on January 7, 2015 15:56

Eric Garrison - I tried removing the custom 404 out of the web.config but it still behaves the same.

I've been emailing Kentico support and they said, "From version 6 to version 7 we completely rewrote the way he handle 404 errors, now we are actually sending the proper headers and handling them appropriately. I believe another change was made was to default the value of redirectMode to ResponseRewrite which is why it is rewriting instead of redirecting."

I also tried their approach but not luck. I'm stump!

0 votesVote for this answer Mark as a Correct answer

Cesar Pinilla answered on January 16, 2016 00:29

Did you find an answer? I've recently come across the same issue and I'm running out of ideas.

In my case it causes problems since the page is not actually being redirected, any runat links in my code that use "~/" go to the root of the server instead of the actual root of my application.

For example: localhost/MYSITE/wrongpage.aspx makes any links that use "~/" redirect to "localhost/" instead of "localhost/MYSITE/"

0 votesVote for this answer Mark as a Correct answer

Timothy Fenton answered on January 17, 2016 20:34 (last edited on January 17, 2016 20:38)

Hello Cesar, I would recommend trying to set your customErrors in web.config like this documentation describes:

https://docs.kentico.com/display/K82/Creating+custom+error+handling+pages#Creatingcustomerrorhandlingpages-Handlinggeneralerrors

the key here is to set the responseMode attribute to redirect instead of rewrite

<customErrors defaultRedirect="~/CMSMessages/Error.aspx" mode="RemoteOnly">
     <error statusCode="404" redirect="absolutepath.com/SomePage/NotFoundError.aspx" responseMode="redirect" />
</customErrors>
0 votesVote for this answer Mark as a Correct answer

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