Add rule to redirect to 404 page

Wei Wang asked on December 1, 2023 13:40

Hi,

Can I create a rule to redirect all urls that have special characters like :, &, etc to a 404 page in Kentico 11? Right now it shows "Server Error in '/' Application." runtime error screen.

It's for Kentico 11 portal engine.

thanks, Wei Wang

Recent Answers


Ömer Karagülmez answered on December 4, 2023 08:56

Hello,

You should review this document for your request.

The default characters listed above are always forbidden unless you override the CMSForbiddenURLValues key in the /configuration/appSettings section of your application's web.config file.

For example:

<add key="CMSForbiddenURLValues" value="$\/:?&quot;&lt;&gt;|&amp;%.&apos;#[] =" />

If you have some other rules for redirecting requests another pages, you can develop custom http handler

Regards.

0 votesVote for this answer Mark as a Correct answer

Wei Wang answered on December 4, 2023 13:26 (last edited on December 4, 2023 13:26)

thank you!

0 votesVote for this answer Mark as a Correct answer

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