Skip to content
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
4 changes: 4 additions & 0 deletions app/models/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,10 @@ def effective_status # rubocop:disable Metrics/PerceivedComplexity
# of climate-related pages to instead of giving them 4xx status codes.
return 404 if redirected_to.ends_with?('epa.gov/sites/production/files/signpost/cc.html')

# Special case for climate.nasa.gov getting moved with bad redirects for all the sub-pages.
return 404 if /^https?:\/\/climate.nasa.gov\/.+$/i.match?(url) &&
redirected_to.ends_with?('://science.nasa.gov/climate-change/')

# We see a lot of redirects to the root of the same domain when a page is removed.
parsed_url = Addressable::URI.parse(url)
return 404 if parsed_url.path != '/' && Surt.surt(parsed_url.join('/')) == Surt.surt(redirected_to)
Expand Down