CNAME records point domains to other domains. But is there a way to point a subdomain to a specific, full URL, like https://domain.com/file.html
?
Not sure if it can do that, but, you can use a index.html
file with the content:
<html>
<head>
<meta http-equiv = "refresh" content= "0; url = target/"/>
</head>
</html>
@poweredbylinux You should be able to do this with a line in your _redirect file.
I don’t want to redirect anything. I want to map a subdomain to a specific file.
Yes we understood what you want, but, that’s the only way possible sadly.
You mean redirecting is the only way?
Also, @hrishikesh, is the code from your answer supposed to redirect to the target URL or show the content from the given URL?
Yes, you can’t use DNS to map to a file as far as I know.
The code I mentioned is a simple HTML redirect. It will redirect as soon as the HTML file loads. And it’s a proper redirect, not just showing contents from the URL. Read more here: HTML meta http-equiv Attribute
Hmm. Thanks for the help.