Skip to content

Commit

Permalink
legacy redirect: Use full path for all the redirections
Browse files Browse the repository at this point in the history
  • Loading branch information
psaiz committed Jan 22, 2024
1 parent 99adf17 commit c55870c
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions cernopendata/modules/pages/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,33 +315,33 @@ def redirect_old_urls(path, year=None):
"""Redirect old urls."""
old_to_new_url_map = {
"about": "docs/about",
"about/cms": "../docs/about-cms",
"about/cms-pileup-simulation": "../docs/cms-guide-pileup-simulation",
"about/cms-simulated-dataset-names": "../docs/cms-simulated-dataset-names",
"about/cms": "/docs/about-cms",
"about/cms-pileup-simulation": "/docs/cms-guide-pileup-simulation",
"about/cms-simulated-dataset-names": "/docs/cms-simulated-dataset-names",
"about/cms-physics-objects": "/docs/cms-physics-objects-{}".format(
year or 2011
),
"about/lhcb": "../docs/about-lhcb",
"about/atlas": "../docs/about-atlas",
"about/alice": "../docs/about-alice",
"about/opera": "../docs/about-opera",
"alice/getstarted": "../docs/alice-getting-started",
"cms/getstarted": "../docs/cms-getting-started-{}".format(year or 2011),
"about/lhcb": "/docs/about-lhcb",
"about/atlas": "/docs/about-atlas",
"about/alice": "/docs/about-alice",
"about/opera": "/docs/about-opera",
"alice/getstarted": "/docs/alice-getting-started",
"cms/getstarted": "/docs/cms-getting-started-{}".format(year or 2011),
"cms-physics-objects": "/docs/cms-physics-objects-{}".format(year or 2011),
"education/cms": "../docs/about-cms",
"getstarted/cms": "../docs/cms-getting-started-{}".format(year or 2011),
"getting-started/alice": "../docs/alice-getting-started",
"getting-started/cms": "../docs/cms-getting-started-{}".format(year or 2011),
"getting-started/lhcb": "../docs/lhcb-getting-started",
"lhcb/getstarted": "../docs/lhcb-getting-started",
"privacy-policy": "docs/privacy-policy",
"research/cms": "../docs/about-cms",
"terms-of-use": "docs/terms-of-use",
"vm/alice": "../docs/alice-virtual-machine",
"vm/cms": "../docs/cms-virtual-machine-{}".format(year or 2011),
"vm/lhcb": "../docs/lhcb-virtual-machine",
"vm/validation/report": "../../docs/cms-vm-validation-2010",
"vm/cms/validation/report": "../../../docs/cms-vm-validation-2010",
"education/cms": "/docs/about-cms",
"getstarted/cms": "/docs/cms-getting-started-{}".format(year or 2011),
"getting-started/alice": "/docs/alice-getting-started",
"getting-started/cms": "/docs/cms-getting-started-{}".format(year or 2011),
"getting-started/lhcb": "/docs/lhcb-getting-started",
"lhcb/getstarted": "/docs/lhcb-getting-started",
"privacy-policy": "/docs/privacy-policy",
"research/cms": "/docs/about-cms",
"terms-of-use": "/docs/terms-of-use",
"vm/alice": "/docs/alice-virtual-machine",
"vm/cms": "/docs/cms-virtual-machine-{}".format(year or 2011),
"vm/lhcb": "/docs/lhcb-virtual-machine",
"vm/validation/report": "/docs/cms-vm-validation-2010",
"vm/cms/validation/report": "/docs/cms-vm-validation-2010",
}

new_url = old_to_new_url_map.get(path) or abort(404)
Expand Down

0 comments on commit c55870c

Please sign in to comment.