CNAMEs can only point to other domains. Redirects like that would be handled on the HTTP level, so you'd need a web server in the mix that sends requesters to the right place when they try to access the subdomain. It can redirect to anywhere, not just domains you control, so the Bluesky example would be handled the same way as the other one.
No, when you make a http request, the route is a part of the headers. DNS is only the name part.
That's being done with a reverse proxy.
Not strictly within the normal way DNS works, no. A CNAME record response can only contain another domain or subdomain name. You would have to run a webserver that listens on the IP that the CNAME record eventually pointed to, in order to handle redirections to a specific URL.
OK. Is there a web service that does this or do I have to run my own service and make the redirects myself?
There is, just google something like "url redirection service" and you'll find lots. Your domain/DNS provider may already offer one as well.
Easiest way to accomplish what you want: host a static html page on blog.example.com that redirects the user to example.com/blog:
https://stackoverflow.com/questions/5411538/how-to-redirect-one-html-page-to-another-on-load
I’ll note that a server side redirect would be preferred if this is for professional or business use. For personal shit, go nuts
Web Development
Welcome to the web development community! This is a place to post, discuss, get help about, etc. anything related to web development
What is web development?
Web development is the process of creating websites or web applications
Rules/Guidelines
- Follow the programming.dev site rules
- Keep content related to web development
- If what you're posting relates to one of the related communities, crosspost it into there to help them grow
- If youre posting an article older than two years put the year it was made in brackets after the title
Related Communities
- !html@programming.dev
- !css@programming.dev
- !uiux@programming.dev
- !a11y@programming.dev
- !react@programming.dev
- !vuejs@programming.dev
- !webassembly@programming.dev
- !javascript@programming.dev
- !typescript@programming.dev
- !nodejs@programming.dev
- !astro@programming.dev
- !angular@programming.dev
- !tauri@programming.dev
- !sveltejs@programming.dev
- !pwa@programming.dev
Wormhole
Some webdev blogs
Not sure what to post in here? Want some web development related things to read?
Heres a couple blogs that have web development related content
- https://frontendfoc.us/ - [RSS]
- https://wesbos.com/blog
- https://davidwalsh.name/ - [RSS]
- https://www.nngroup.com/articles/
- https://sia.codes/posts/ - [RSS]
- https://www.smashingmagazine.com/ - [RSS]
- https://www.bennadel.com/ - [RSS]
- https://web.dev/ - [RSS]