Skip to content

Redirect user from the original URLs of HOA v2 to new URLs format #97

@WDGaster703

Description

@WDGaster703

Description

The original URLs cannot be correctly redirected:

Proposed Solution

If we can detect the cookies of user(which store user's preferred major_code and enrollment_year), and the course code (i.e. EE1018) exists in the path, we will redirect user to the course page.

Otherwise, we will redirect the user to the latest available year where the course page exist.

For example:

If we stored the user's cookie https://hoa.moe/docs/2019/040201 before, and https://hoa.moe/docs/2019/040201/sophomore-autumn/EE1018 exists, we will redirect https://hoa.moe/docs/fresh-spring/ee1018 to https://hoa.moe/docs/2019/040201/sophomore-autumn/EE1018

Otherwise, we will find the latest year that EE1018 is available, and redirect the user to that page when he clicks the original link.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggood first issueGood for newcomers

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions