Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Cloud Storage CNAME URL Redirect

I have a public bucket 'wordgamesswf' on Google Cloud storage where objects can be accessed with urls http://commondatastorage.googleapis.com/wordgamesswf/linguistics

I need to host the files from my domain so i added a CNAME redirect from wordgamesswf.addictingwordgames.com to c.storage.googleapis.com

I'm trying to access the object at http://wordgamesswf.addictingwordgames.com/linguistics

but im getting the following error

    <Error>
     <Code>NoSuchBucket</Code>
     <Message>The specified bucket does not exist.</Message>
    </Error>

is there something i missed?

like image 414
lee penkman Avatar asked Sep 05 '13 23:09

lee penkman


People also ask

Can I upload files to Google Cloud Storage from URL?

Solution OverviewShipyard helps you download a file from any publicly accessible URL and upload it directly to Google Cloud Storage for usage at a later time.


2 Answers

Your bucket name is wordgamesswf and your domain name is addictingwordgames.com.

To access objects via http://wordgamesswf.addictingwordgames.com/linguistics you have to create a bucket named "wordgamesswf.addictingwordgames.com" and make CNAME entry as -

wordgamesswf.addictingwordgames.com CNAME c.storage.googleapis.com.

By doing this, you can use the following URL to access linguistics from wordgamesswf.addictingwordgames.com:

http://wordgamesswf.addictingwordgames.com/linguistics

like image 148
Neelam Sharma Avatar answered Oct 15 '22 01:10

Neelam Sharma


This approach worked for me:

  1. create a bucket as the same name as your subdomain. like sub.domain.ltd

  2. Because it is a real subdomain, Google will ask you to verify the ownership. Simply follow the requirement and prove you are the owner of the domain.

  3. create a CNAME for sub.domain.ltd and point it to c.storage.googleapis.com.

  4. Access your file by going to sub.domain.ltd/file. You do not need to go to sub.domain.ltd/sub.domain.ltd/file

It should work! Also, you can use some CDN features on your own subdomain.

like image 20
user2793508 Avatar answered Oct 15 '22 00:10

user2793508