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

USAGOV-2016-v3: USAGOV-2016 nginx redirects #2151

Merged
merged 2 commits into from
Jan 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .docker/src-www/etc/nginx/partials/internal_redirects.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Proxy directives for the public site. May be included in CMS for local/cms testing

location / {
# Decode the URI for proper matching
set $decoded_uri $uri;
if ($decoded_uri ~* ^(.+?)(%C2%A0|\xA0|%E2%80%89|\xE2\x80\x89|%E2%80%83|\xE2\x80\x83)+$) {
set $clean_uri $1;
return 301 $clean_uri;
}
# Match and strip other partial %C2 sequences from the end of the URI
if ($uri ~* ^(.+?)(%C2|\xC2)+$) {
set $clean_uri $1;
return 301 $clean_uri;
}
}

# Federal and state directory PERMANENT redirects:
rewrite ^/federal-agencies/a$ /agency-index permanent;
rewrite ^/federal-agencies/([^/])$ /agency-index/$1 permanent;
Expand Down
Loading