Redirect HTTPS domains to HTTP or HTTPS domains using Github Pages

View the Project on GitHub adrw/https-redirect-javascript-with-meta-fallback

HTTPS Redirect with Javascript and Meta Fallback

Redirecting HTTPS links is not possible with DNS 301 URL redirect records.

For example, using DNS alone can not be redirected to

Instead, the HTTPS for must terminate at a server before the client can be redirected to

Thus this repo:

Styled HTTPS Redirect for


  1. Hit the Use Template button to create a new repo using this repo as template
  2. Move files from src/ into the top level directory
  3. Copy 404.html to index.html
  4. grep throughout 404.html for (old site) and (new site) to replace with your redirect source and target values
  5. Update CNAME file with your source website that you want to redirect from
  6. Go to repo settings
  7. Turn on Github Pages from master branch
  8. Update DNS settings for source domain to point at this repo. Check Github docs for more complex configuration.
     A       @
     A       @
     A       @
     A       @
     CNAME   www