A simple template for redirecting your GitHub Pages site (username.github.io) to your custom domain.
- ✨ Lightweight and fast redirect solution
- 🎯 Easy to set up in minutes
- 📱 Works on all devices and browsers
- 🔗 Preserves URL paths during redirect
- Fork or use this template to create a new repository named
username.github.io - Update the domain in the HTML file:
- Replace
example.comwith your actual domain
- Replace
- Enable GitHub Pages in your repository settings
- Visit
https://username.github.ioto test the redirect
This template uses a simple HTML meta refresh to redirect visitors from your GitHub Pages URL to your custom domain. The redirect happens automatically when users visit your username.github.io page.
- Click "Use this template" on the GitHub repository page
- Name your repository
username.github.io(replaceusernamewith your GitHub username) - Customize the domain in
index.html
- Create a new repository named
username.github.io - Copy the contents of this template to your repository
- Update the redirect URL in
index.html - Push to GitHub
Edit index.html and change this line:
<meta http-equiv="refresh" content="0;url=https://example.com" />
<link rel="canonical" href="https://example.com" />Replace https://example.com with your actual domain.
- Redirect not working? Ensure your repository is named exactly
username.github.ioand GitHub Pages is enabled - Need to change the redirect delay? Modify the
content="0;url=..."value (0 = immediate) - Want to customize the loading page? Edit the HTML content before the meta redirect tag
Feel free to use this template for your own projects!
Have questions? Check the GitHub Pages documentation or open an issue in this repository.
Made by Stux.Cloud
Stux.Cloud is part of the Stux.Group Brand of Companies.
