Before you read the rest I am an absolute beginner at deploying website and the end goal would be:
My website I want to load is
site.s3-website.us-east-2.amazonaws.com
and I want all the content to be put on
mydomain.com
So when you visit mydomain.com you see see all the content that is supposed to be on the AWS S3 Site.
I have followed many articles and posts, however I don't seem to be getting the expected results or they seem to be outdated.
The best way is to migrate to route 53.
However, you can set up a redirect or simply set up an CNAME record that resolves to S3 Static website URL.
The last step is to Forward domain to your naked domain name "example.com" to "www.example.com
NOTE: You could just Forward to your bucket using the complete bucket URL with "name masking", however most web crawlers will not see your complete site if you do it that way and web searches will fail.
Hope this helps!
The S3 bucket name must be the same as the domain name, so your bucket should be called mydomain.com. Then just add a cname in your DNS to resolve to mydomain.com.s3-website.us-east-2.amazonaws.com
Related
I have followed the instructions given on https://cloud.google.com/storage/docs/hosting-static-website, yet my domain name still lands on the page with this error:
This site can’t be reached
afrikincm.com’s server IP address could not be found.
Search Google for afrikincm
ERR_NAME_NOT_RESOLVED
My doamin registrar is goDaddy.com and all i did there was:
see godaddy dashboard
All objects added to my bucket on Google Cloud Platform have been made public yet something still doesn't seem to be working right.
I really will appreciate some help here guys.
Thanks
It seems that something is wrong and somewhere down the line and the DNS record is not resolving to the content of your gcs bucket.
First of all, be sure that the bucket name is exactly the value that you are specifying as CNAME.
Then review and re-take the steps suggested in the documentation.
Make sure that billing is enabled
Verify that you own and manage the domain that you'll be using: webmaster central
Create a CNAME record that points to c.storage.googleapis.com
Create a bucket whose name matches the CNAME you created for your domain
put files in your bucket (like an index.html)
make all object public with gsutil iam ch allUsers:objectViewer gs://[BUCKET_NAME]
setup index + error page with: gsutil web set -m index.html -e 404.html gs://[BUCKET_NAME]
Judging from the error, it seems that something is wrong with the godaddy records or the bucket name or the verification step :)
I am trying to use a combination of CloudFlare and AWS S3 service to host a static website. My issue is that I have an "index.html" file and navigating to the S3 URL directly:
http://srdan.nz.s3-website-ap-southeast-2.amazonaws.com
it loads the "index.html" file (note, no mention of "index.html" in the URL).
However, if I go to the custom domain URL:
http://srdan.nz
It returns an S3 XML listing of the bucket contents:
<ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Name>srdan.nz</Name><Prefix></Prefix><Marker></Marker><MaxKeys>1000</MaxKeys><IsTruncated>false</IsTruncated><Contents><Key>index.html</Key><LastModified>2018-10-09T01:10:39.000Z</LastModified><ETag>"f51109004d6b0518fad4c2f69d950a45"</ETag><Size>133</Size><StorageClass>STANDARD</StorageClass></Contents></ListBucketResult>
instead of the contents of "index.html".
Does anyone know why this is the case? How do I configure Cloudflare/S3 to make the "index.html" file the "default" thing to return if someone just enters the URL?
I've got a workaround where I add a custom "Page Rule" to Cloudflare to redirect "http://srdan.nz/" to "http://srdan.nz/index.html" however, I'd strongly prefer if it would just return the contents of "index.html" directly.
The answer to this is as #Michael mentioned in the comments of the question, but I thought it deserved a writeup...
Take the example domain mybucket.com that we'd like to use to serve the contents of our s3 bucket from via Cloudflare.
Whilst the following URL is valid for just accessing the contents of the S3 bucket mybucket.com.s3.amazonaws.com it's no good for referencing in our Cloudflare CNAME DNS record.
I think that one of the main problems is that the Cloudflare documentation doesn't show the correct static website endpoint as stated in the AWS S3 documentation for serving a static website from s3.
You might find that if you use the incorrect end point in your Cloudflare DNS, your domain will return something like the following response at the root instead of your default document as setup in the bucket settings:
ANSWER: Use the static website endpoint
Ensure that the CNAME record that you set up uses the -website- equivalent endpoint:
mybucket.com.s3-website-us-west-2.amazonaws.com
The correct format is <BUCKET NAME>.s3-website-<AWS REGION>.amazonaws.com, but it can be found in the settings for your s3 bucket:
Don't use the others, incorrect ones include
mybucket.com.s3.amazonaws.com
mybucket.com.s3-us-west-2.amazonaws.com
NB: You'll need to set SSL in Cloudflare to 'Flexible' because 'Full' and 'Full(strict)' do not work.
We want to redirect our oldwebsite.com to newwebsite.com and both of the domains are managed in AWS Route53. The developer who set this up originally is not reachable.
I created an S3 bucket for oldwebsite.com and set it to redirect to newwebsite.com over http. Then on the Route53 hosted zone of oldwebsite.com, I chose the S3 bucket I created as an Alias name for the Type 'A' record set.
Our oldwebsite.com is down. I am pretty sure I have set the right values, but the oldwebsite.com still shows one of those "there is no website here, buy this website" type pages.
Further more, if I type www.oldwebsite.com, then that page opens, but if I type simply oldwebsite.com, it opens a 404 page not found on Hostgator.
Any help on where to check would be appreciated.
I am having trouble redirecting route53 domain to my S3 bucket.
I have created a working bucket which you can access trough this url:
http://linas.me.uk.s3-website.eu-west-2.amazonaws.com/
The bucket name matches domain name and I am able to setup new record set with linas.me.uk alias target. However when you try visiting http://linas.me.uk 404 gets thrown.
I have tried anything I could think of or find googling but I have hit the wall it seems, any help would be appreciated!
This is another problem I am having, here is the info.
My endpoint for the first bucket works, but not the 2nd bucket, and using my domain name in the browser just doesn't work at all.
Once again I have taken screenshots, this is driving me insane, I have no idea how to correct it, it just doesn't find my root or something.
Record Sets
Buckets
I can't post more than 2 links
If anyone can help me, even PM me, I'll give my login details to take a look, because I'm completely stumped.
You should follow the directions on Setting Up a Static Website Using a Custom Domain.
For the first bucket, the steps are:
Create an Amazon S3 bucket with the same name as your domain (justdiditonlne.com)
Add a bucket policy to make the content public, or modify desired objects to make them publicly accessible
Turn on Static Website Hosting, and you will receive a URL like: justdiditonline.com.s3.amazonaws.com
Create a Route 53 entry for justdiditonline.com, type A, set Alias=Yes and enter the static website hosting URL
For the second bucket:
Create an Amazon S3 Bucket with the desired domain name (www.justdiditonline.com)
Turn on Static Website Hosting, but this time select Redirect all requests to another host name. Enter www.justdiditonline.com.