DEV Community

Cover image for How to serve *any* website from your own domain (for free!)

How to serve *any* website from your own domain (for free!)

Mohit Yadav on August 13, 2022

Have you ever wanted to white-label a website, like display it on your own domain? Or have you wanted to remove a watermark from a website that ask...
Collapse
 
cicirello profile image
Vincent A. Cicirello •

Neat approach that gets the job done. I'm curious though what the benefit is of even using bio.link here at all? It is just a simple single page. Why not instead just create a repo in GitHub with the single page of links served from GitHub Pages and point your links subdomain at that with a CNAME record? [Or some other similar service like GitLab Pages].

Collapse
 
just_moh_it profile image
Mohit Yadav •

Umm, this really boils down to convenience...

I've already created a lot of links-in-bio pages in the past (some of them were super over-engineered, like edge-caching, redis and integrated admin dashboard), and I'm sure there are many bio-link open-source alternatives that reduce the entry barrier even further.

But I really like the convenience of changing the background image, having professionally-curated themes, repositioning links, not care about hosting or downtime, and since it's free, I really think I'd need a lot of good reasons to move away, but custom-domains aren't a good enough reason imo ๐Ÿ™ƒ.

Btw, I used bio-link as an example of how it could be utilized, but I usually use this technique for websites like framer, that have a watermark on the page and a custom domain requires premium... Cloudflare workers solves both, without costing a penny ๐Ÿ˜ƒ

Collapse
 
cicirello profile image
Vincent A. Cicirello •

That makes sense. At first glance, the bio.link looked nothing more than a single page with some links and photo. But I can see the benefit considering the themes and other functionality especially if already using.

Thread Thread
 
just_moh_it profile image
Mohit Yadav • • Edited

Yep, totally! I really don't like parts of development like optimizing CSS for mobile layouts, so yeah, I guess existing solutions are good as long as they work well ๐Ÿ˜ƒ

Collapse
 
michaelmior profile image
Michael Mior •

Another important con is that in a lot of cases, it's probably a violation of terms of service of whatever site you're using. When using this approach to remove a watermark, that's almost certainly the case.

Collapse
 
just_moh_it profile image
Mohit Yadav •

Another important con is that in a lot of cases, it's probably a violation of terms of service of whatever site you're using. When using this approach to remove a watermark, that's almost certainly the case.

Yep, it might be in most cases (certainly is, in the framer example), and that's why I've written (for educational purposes only) everywhere I guess where that might the case!

Thanks for reading ๐Ÿ”ฅ

Collapse
 
ravavyr profile image
Ravavyr •

A neat exercise, but...you do realize this means you now have 2 domains with identical content so google will consider your new domain a duplicate of the first one and rank both sites lower since the content is no longer "unique" ?

This is bad for SEO is what i'm saying.

Other than that, i guess it's ok. I don't see much use for it, if i wanted domain B to point to content of A then i'd set up the site under domain B to start with.

You can do that easily by buying the domain, and using netlify/heroky/digital ocean apps for a static site or get a hosting server for like $5/month if you need a database and a dynamic setup.

Collapse
 
just_moh_it profile image
Mohit Yadav •

A neat exercise, but...you do realize this means you now have 2 domains with identical content so google will consider your new domain a duplicate of the first one and rank both sites lower since the content is no longer "unique" ?

That's a great point! I think we could easily prevent that by modifying the Cloudflare workers' script to contain a canonical tag.

Other than that, i guess it's ok. I don't see much use for it, if i wanted domain B to point to content of A then i'd set up the site under domain B to start with.

Sure, you could always do that, but the use-cases I illustrated for the demo don't actually have that functionality. One essential requirement of the way you're implying is that the app should be open source, and the use-cases I show for are either, non-open source, or have limitations on the 'traditional' way to add a domain, such as the lack thereof, or the functionality sitting behind a paywall.

Thanks for reading and your awesome arguments ๐Ÿ”ฅ๐Ÿ˜ƒ

Collapse
 
jacksonkasi profile image
Jackson Kasi •

๐Ÿค˜

Collapse
 
just_moh_it profile image
Mohit Yadav •

๐Ÿ™ƒ

Collapse
 
ccoveille profile image
Christophe Colombier •

Great article, you also made me discover bio.link

Collapse
 
just_moh_it profile image
Mohit Yadav •

Haha... it's pretty awesome that every bio.link feature is free! ๐Ÿ˜ƒ

Collapse
 
sarveshh profile image
Sarvesh Patil •

This is an amazing post Mohit. Thanks a lot. Saved me a ton of time!

Collapse
 
dhravya profile image
Dhravya •

Such an amazing post. Thank you!

Does this work for full domains (like fueler.io/dhravya)

Collapse
 
just_moh_it profile image
Mohit Yadav •

Hey! I guess it should, since it's just a simple HTML page... don't know about the subpages though, but they should work with a few modifications in the script!