Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save julkue/7150101962e2645731b54547ffa00268 to your computer and use it in GitHub Desktop.
Save julkue/7150101962e2645731b54547ffa00268 to your computer and use it in GitHub Desktop.
Why to host GitHub project websites on own servers?

Why to host GitHub project websites on own servers?

  1. When using GitHub pages to host a website this means that the website will be published over and over again for each fork (after a push). This is a problem for search engine optimization as it will be duplicate content. This is also a user experience problem, as users don't know which website is the original one.
  2. With GitHub pages it not possible to use htaccess. This is a problem for the following situations:
    • Calling a directory with "/" and with "/index.html" is possible (duplicate content)
    • Calling "user.github.io/repo" will not redirect to custom domains. As using htaccess isn't possible too, we can not redirect users to the domain with 301. The user will always see the website with the wrong URL for a moment (duplicate content) while getting redirected with <meta>.
    • When you need to enforce https
  3. GitHub pages does not allow you to specify a root directory for your website inside the branch. So you do not have any way to prevent requests to content that is not ready for distribution. Typically a web-app will be generated to a "dist" folder, which then will be made public.
  4. GitHub pages does not allow you to specificy a custom 404 page.
  5. And of course, GitHub pages doesn't allow you to execute e.g. PHP files. You can only host static sites.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment