Create redirects from an external link to a GitHub pages repo

Is there way to redirect yourname.com/cv to yourname.github.io/cv without changing the URL in the address bar?

:wave: Welcome!

I’ve done this although it’s a little messier than just setting up the CNAME since you’ll need separate hosting, and the redirect is done by a browser which can mean that browser settings and extensions could interfere.

First, you’ll need something hosting yourname.com/cv so you can create a file.

You’ll want that file to include

<!DOCTYPE html>

<html>

   <head>
      <meta http-equiv = "refresh" content = "0; url = https://yourname.github.io/cv />
   </head>

</html>

The 0 is time in seconds, so you can also configure a delay if you want to display a redirect message, for instance. This can be helpful in the situation where someone whose browser settings or extensions are blocking the redirect - they’ll know what’s gone wrong and how to fix it.


<!DOCTYPE html> 

<html> 

  <head> 

    <title> Page title </title> 

    <meta http-equiv="refresh"
        content="5; url = https://yourname.github.io/cv" /> 

</head> 
  
<body> 

    <h1 style="text-align:center;color:blue;"> 
    Nothing to see here, move along
    </h1> 
  
    <p style="text-align:center;"> 
        If you're not redirected to 
https://yourname.github.io/cv in 5 seconds, please
click <a href="https://yourname.github.io/cv"> here </a>.
    </p> 

</body> 

</html>