Skip to content

πŸ› 403 redirect to a 404 on prod environmentΒ #1383

@AntoLC

Description

@AntoLC

Bug Report

https://docs.numerique.gouv.fr/docs/[DOC_ID]/403/ is not intercepted by the Nginx regexp, leading to a redirect to a 404 page during reload.

location ~ "^/docs/[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/?$" {
try_files $uri /docs/[id]/index.html;
add_header X-Frame-Options DENY always;
}

Possible solution

Remove the 403 page, display a 403 on the current url https://docs.numerique.gouv.fr/docs/[DOC_ID]/.
Add as well meta if error status:

<meta name="robots" content="noindex" />
<link rel="canonical" href={`/docs/${docId}`} />

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions