Page not found issue

Khoa Nguyen asked on August 20, 2018 04:11

I got an error, when go to the url contain "&"

For example:

/product&abcd => throw error

/product?category=abcd => access to page

/product-abcd => go to page not found status 404

In webconfig setting <pages validateRequest="false" clientIDMode="AutoID">

Here is screenshoot error from page and event log

http://prntscr.com/kklpmw

http://prntscr.com/kklq5y

Correct Answer

Anton Grekhovodov answered on August 21, 2018 15:02

Hi Knoa,
Try to add the following configuration to you web.config:

<system.web>
...
<customErrors defaultRedirect="~/404" redirectMode="ResponseRedirect" mode="On">
  <error statusCode="400" redirect="~/404" />
</customErrors>
...
</system.web>
0 votesVote for this answer Unmark Correct answer

Recent Answers


Brenden Kehren answered on August 20, 2018 06:06

This URL isn't valid, the querystring needs to start with a ? not a &.

/product&abcd

Should be

/product/abcd

If you set a wild card URL up for the page or

/product?category=abcd

If you didn't.

A wild card URL would be on the page under URL Aliases. It would look like this:

/product/{category}

3 votesVote for this answer Mark as a Correct answer

Khoa Nguyen answered on August 21, 2018 03:55

Hi Brenden Kehren,

How we can control if client typing invalid url like that, it should go to page not found, not throw an error..

0 votesVote for this answer Mark as a Correct answer

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