IIS httpErrors ExecuteURL appends weird query string like 500;http://mysite.com/failed-page to the target URL

Adding a trailing slash to the path (e.g. path="/error-page/") will stop the error code and URL being appended, note that it will keep the original failing URL, e.g.

  • If there is no trailing slash, then the contents of error-page will be shown with the URL: http://example.com/error-page?500;http://example.com/failingpage
  • If there is a trailing slash, then the contents of error-page will be shown with the URL: http://example.com/failingpage