0

I bought a domain (on Google Domains) for a personal webpage and set it up to point to my github.io page

I also added a subdomain (say somefile.mydomain.example) and it now redirects to a Google Drive URL

Is there any way I can mask the actual file URL here? If I need to change the file later, I want to make sure bookmarks point to the new file.

I have considered updating just versions of the same file, yes, but I am trying to find something that would work on, say, different Google Forms, or something of the sort.

I have also tried using a subdomain redirection provider to redirect my-subdomain.their-domain.example to the file URL and then set up CNAME redirection in my DNS, but that doesn't work, because I think their server would not expect a request for somefile.mydomain.example or even somefile.their-domain.example

  • If there isn't a configurable server that's serving the file (as is the case with Google Drive), I'm afraid it's only possible to redirect to the file's URL. You could use a URL shortening service though - some allow for CNAME's to point to them with ability to mask URLs (recommendations for them are unfortunately off-topic here). – dan Apr 4 at 0:46
  • A CNAME is not a redirect. A CNAME points the IP address to the same IP address as another domain. However it has no bearing on how that server handles the HTTP request. The server could serve different content, or it could issue a redirect. Setting a CNAME in no way causes a redirect by itself. – Stephen Ostermiller Apr 4 at 10:14
  • Masking is not usually a good solution for assigning a domain name to content. When it is a whole site, it prevents the URL from changing as users click around. For a single file, at least you won't have that disadvantage. The biggest problem is that search engines see right through it and index the final URL rather than the mask URL. Anybody who finds your file through search engines would not get your custom domain. – Stephen Ostermiller Apr 4 at 10:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.