I How to set a redirect

I.1 Non GitHub pages site (e.g. Netlify)

Replace the content of the current website with

<html>
<head>
<meta http-equiv="refresh" content="0;URL=https://docs.ropensci.org/<pkgname>/" />  
<script language="javascript">
  window.location.href = "https://docs.ropensci.org/<pkgname>"
</script>
</head>
</html>

I.2 GitHub pages

You can setup the redirect from your main user gh-pages repository:

  • create a new repository (if you don’t have one yet): https://github.com/<username>/<username>.github.io
  • In this repository create a directory <pkgname> containing the file index.html that redirects to the new location (see previous subsection)
  • Test that https://.github.io//index.html now redirects
  • Optional: you could even create a 404.html file in your <username>.github.io repo to redirect arbitrary pages, like here: https://github.com/ropensci/ropensci.github.io.