Last post Apr 02, 2018 06:11 PM by 0belix
Mar 29, 2018 04:56 PM|0belix|LINK
i have set up my web.config with the following lines:
<httpErrors errorMode="Detailed" existingResponse="Replace">
<remove statusCode="404" subStatusCode="-1" />
<error statusCode="404" path="/page_not_found.aspx" responseMode="ExecuteURL" />
Whenever i attempt to get a nonexistent page, i am correctly redirected to the page_not_found.aspx page as set on the web.config, but apparently Google is not recognizing this with the 404 error code.
What should i do? is there some sort of meta that i need to place on my custom 404 page? can't i use this method but rather configure on IIS the error pages? If so, how can i easily achieve that?
Apr 02, 2018 07:34 AM|Brando ZWZ|LINK
As far as I know, if you used the ExecuteURL, it will directly rewrite the url with the custom error page instead of showing the 404 error.
So you will find it doesn't show the 404.
ExecuteURL: Serves dynamic content (for example, an .asp file) specified in the path attribute for the custom error. If responseMode is set to ExecuteURL, the path value has to be a server relative URL. The numeric value is 1.
If you want to show the 404 error, I suggest you could try to use a static content.
File: Serves static content, for example, a .html file for the custom error. If responseMode is set to File, the path attribute value has to be a file path. The numeric value is 0.
Then you could replace the static content as your custom error page.
Apr 02, 2018 06:11 PM|0belix|LINK
Thx for the reply.
So, if i understood correctly, if i go from an ASPx file to an HTML file and change the responseMode property from ExecuteURL to File, then the 404 error type will be associated with the response, so Google will correctly index it as a 404 error?