Can github pages CNAME file contain more than one domain?
Example file:
reggi.com www.reggi.com blog.reggi.com
Usage limitsPublished GitHub Pages sites may be no larger than 1 GB. GitHub Pages sites have a soft bandwidth limit of 100 GB per month. GitHub Pages sites have a soft limit of 10 builds per hour. This limit does not apply if you build and publish your site with a custom GitHub Actions workflow.
Yes, it is possible to have multiple GitHub Pages sites within one account. Create another GitHub repository and push your site files to the gh-pages branch.
On your site's repository, click the settings tab . Under custom domain, type your custom domain and save. GitHub will automatically create a commit with a CNAME file at the root of your repository. Visit the dashboard provided by your domain provider and add a CNAME record pointing to your subdomain.
On GitHub, navigate to your site's repository. Under your repository name, click Settings. In the "Code and automation" section of the sidebar, click Pages. Under "Custom domain", type your custom domain, then click Save.
No, this is not possible. See the GitHub Help docs that explain this:
Ensure you only have one domain listed in your CNAME file. If you wish to have multiple domains pointing to the same Pages, you will need to set up redirects for the other domains. Most domain registrars and DNS hosts offer this service to their customers.
Here is one approach that is a Github-only solution using an HTML redirect.
index.html
file with the following contents<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Redirecting to https://example.com</title> <meta http-equiv="refresh" content="0; URL=https://example.com"> </head> <link rel="canonical" href="https://example.com"> </html>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With