MetaBrainz Foundation

CB: Redirect release URLs to their respective release-group one

CritiqueBrainz generally follows the same URL structure as MusicBrainz does, which means that it's possible to go from https://musicbrainz.org/artist/4d56eb9f-13b3-4f05-9db7-50195378d49f to https://critiquebrainz.org/artist/4d56eb9f-13b3-4f05-9db7-50195378d49f simply by replacing "music" in musicbrainz.org with "critique". This is true for /artist/, /event/, and /release-group/ URLs. However, often you'll be at a Release page, say https://musicbrainz.org/release/4a3541a7-db1d-4da2-a36b-172c5f8b2cc4, and maybe you want to write a review or see if there are any reviews for it, so you "hack" the URL to make https://critiquebrainz.org/release/4a3541a7-db1d-4da2-a36b-172c5f8b2cc4 - but since CritiqueBrainz doesn't recognise /release/ URLs, you just get an error page. :(

Your task is to make /release/ URLs make a 301 HTTP redirect to their parent /release-group/ URL (e.g., the /release/ example from before would redirect to https://musicbrainz.org/release-group/4d1e6020-324d-4e8c-af1d-c7a2525a15ee).

References:

Task tags

  • critiquebrainz
  • python

Students who completed this task

Ohm Patel

Task type

  • code Code
close

2015