erlang-org
erlang-org copied to clipboard
Replace www links with /
Speaking of links, one things that I have had on my todo list is to change any links that point to www.erlang.org to instead point to / if they are not to be redirected in _redirects. This would allow the broken link checker to check those links as well just to make sure that they remain.
Originally posted by @garazdawi in https://github.com/erlang/erlang-org/pull/61#pullrequestreview-855608153
These are the contents of _redirects
## Redirects to erlang.org
/download/* https://erlang.org/download/:splat
/~* https://erlang.org/~:splat
/course/* https://erlang.org/course/:splat
/documentation/* https://erlang.org/documentation/:splat
/mailman/* https://erlang.org/mailman/:splat
/mailman-icons/* https://erlang.org/mailman-icons/:splat
/pipermail/* https://erlang.org/pipermail/:splat
## Old removed URLs
/doc/search /doc
/docs/versions /documentation
/rss/news/* /news.xml
/erlang-enhancement-proposals/home.html /eeps/
/erlang-enhancement-proposals/* /eeps/:splat
## Redirects from old sites
https://blog.erlang.org/feed.xml https://www.erlang.org/blog.xml 301!
https://blog.erlang.org/* https://www.erlang.org/blog/:splat 301!
https://bugs.erlang.org/browse/* https://www.erlang.org/bugs/:splat 301!
https://bugs.erlang.org/* https://github.com/erlang/otp/issues 301!
So what should we do?
This is an example of such a link, as it does not do any redirect: https://github.com/erlang/erlang-org/blob/master/_news/149.md?plain=1#L24
However, we do not want this type of link to be changed:
https://github.com/erlang/erlang-org/blob/master/_news/145.md?plain=1#L22-L26
as they are caught by the redirect.
I would expect that almost all of the links we want to rewrite point to https://www.erlang.org/doc/, but there might be other as well.
What I will do is replace now that the links are standardized , replace https://www.erlang.org/ with /
when go over the redirect rules and find (/download|/course) etc and prefix them with https://erlang.org that way we are explicit as when we redirect out of the site. WDYT?
So in other words, do no rely on _redirect rules for links within the site, and only leave those rules from incoming links from the outside
Once done we can run a link checker throughout the site and find broken links and fix them manually.