Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UseStatusCodePagesWithRedirects doesn't work #6408

Closed
sonichanxiao opened this issue May 14, 2018 — with docs.microsoft.com · 3 comments
Closed

UseStatusCodePagesWithRedirects doesn't work #6408

sonichanxiao opened this issue May 14, 2018 — with docs.microsoft.com · 3 comments
Assignees
Labels
Pri2 Source - Docs.ms Docs Customer feedback via GitHub Issue

Comments

Copy link

Not sure if I did anything wrong or missed something. Tried to add app.UseStatusCodePagesWithRedirects("/error/{0}"); within Startup.cs under Configure, t gives me a Can't reach this page error. Error Code: INET_E_REDIRECT_FAILED.
Do I need to create a page e.g. 403.cshtml under /Error/ folder?


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@guardrex
Copy link
Collaborator

guardrex commented May 15, 2018

Thanks @sonichanxiao for mentioning this. Yes, that's correct. Create a view/page for the endpoint. I just so happen to have such a endpoint in a few of my test Razor Pages apps because they use ...

app.UseStatusCodePagesWithReExecute("/Error/{0}");

... so I have a Razor Page (Error.cshtml) set up like this ...

@page "{statusCode?}"
@model ErrorModel

<!DOCTYPE html>
<!-- REST OF THE PAGE FOLLOWS HERE -->

I'll do some work on the doc to make it clear that a page/view must be created to receive a redirect or re-execute.

@guardrex guardrex self-assigned this May 15, 2018
@guardrex guardrex added Pri2 Source - Docs.ms Docs Customer feedback via GitHub Issue labels May 15, 2018
@guardrex guardrex added this to the 2018 - Quarter 2 milestone May 15, 2018
@sonichanxiao
Copy link
Author

Thank you @guardrex , Or an updated sample code in Github would also do the job.

@guardrex
Copy link
Collaborator

Good idea. I'll make a note on the sample tracking issue for this. #5495

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Pri2 Source - Docs.ms Docs Customer feedback via GitHub Issue
Projects
None yet
Development

No branches or pull requests

2 participants