Skip to main content
1 of 2
Stephen Ostermiller
  • 99.4k
  • 18
  • 141
  • 364

It isn't possible to set up redirects for some paths but not others using your domain registrar or DNS host. You have to implement any redirects on your web host (github pages).

In fact, it isn't possible to implement redirects without a webserver at all. Even if your domain registrar offers to redirect your domain, it does so by pointing the domain to its own web server and configuring its own webserver to issue the redirects for the domain.

The reason that it isn't possible to use DNS to redirect some path but not others is that DNS points the whole domain to one web server. You can't use DNS to specify different servers for different paths. It's all or nothing.

You have several options:

  1. Create simple pages for each product page you want to redirect and upload them to Github pages. Each page would contain a meta refresh that would direct browsers to redirect: <meta http-equiv="refresh" content="0;url=https://www.example.com/product" /> . For full details see: Redirect a GitHub Pages site with this HTTP hack | Opensource.com

  2. Move web hosts. I don't recommend using Github pages because they don't provide a way to do SEO friendly "301 permanent" redirects. Almost all other web hosts would allow you to properly configure redirects. You could move your site to another web host that supports such functionality.

  3. Use a content delivery network (CDN) and configure the redirects using it. A CDN acts as a front-end reverse-proxy server for your website. Each user fetches your site from an edge node owned by the CDN that is geographically near to the user. If the edge node doesn't have the content, it fetches it from your origin server (which would be github pages) and caches it for the next user. This gives the CDN the ability to add rules for paths as it sits between your users and your web server. For example you could configure page rules on Cloudflare

Stephen Ostermiller
  • 99.4k
  • 18
  • 141
  • 364