Reputation: 1438
I have my web.config setup as follows:
<customErrors mode="RemoteOnly" redirectMode="ResponseRedirect" defaultRedirect="~/SpecialPages/PageNotFound.aspx">
<error statusCode="404" redirect="~/SpecialPages/PageNotFound.aspx" responseMode="Redirect"/>
</customErrors>
But when a user goes to mysite.com/gibberish, my 404 page shows up, but the url stays as mysite.com/gibberish, but I want it to say mysite.com/SpecialPages/PageNotFound. Is there somethng else I am missing?
I'm using Kentico10 CMS if that makes any difference but have been following their instructions too. Seems like I'm missing something server side.
Upvotes: 0
Views: 113
Reputation: 1438
In case anybody is reading I got an answer from kentico themselves:
This behavior is correct from SEO point of view. Previously we had the behavior you wanted but it was really bad for SEO to do a redirection so it was changed and just the 404 status code is returned and the URL is the same. If you want to change this behavior, you can create custom event handler and in the request end event check the status code and if it is 404, do a redirection - but this can harm your SEO rankings.
Upvotes: 0
Reputation: 2209
Have you specified Page not found
in Kentico? If so, remove that configuration beacuse you don't want Kentico to handle error for you and then your custom errors in web.config should work as you set them up as in any other project.
Upvotes: 1