GCP Error: 301: Moved Permanently error, while trying to access a directory path on google cloud storage.

0 votes
Accessing a directory path returns an empty object and a 301 HTTP response code.
4 days ago in GCP by Sam
• 2,100 points
8 views

1 answer to this question.

0 votes

If your browser downloads a zero byte object and you get a 301 HTTP response code when accessing a directory, such as http://www.example.com/dir/, your bucket most likely contains an empty object of that name. 

To check that this is the case and fix the issue:

  1. Open the Cloud Storage browser in the Google Cloud Platform Console.

  2. Click the Activate Cloud Shell button at the top of the Google Cloud Platform Console. 

  3. Run gsutil ls -R gs://www.example.com/dir/. If the output includes http://www.example.com/dir/, you have an empty object at that location.

  4. Remove the empty object with the command: gsutil rm gs://www.example.com/dir/

You can now access http://www.example.com/dir/  and have it return that directory's index.html file instead of the empty object.

answered 4 days ago by Sirajul
• 29,340 points

Related Questions In GCP

0 votes
1 answer

Access not configured Error while trying to use Cloud DNS.

This might be probably because you wouldn't ...READ MORE

answered 3 days ago in GCP by Sirajul
• 29,340 points
9 views
0 votes
1 answer

GCP Error: 403: Access Denied

Check that your credentials are correct. For ...READ MORE

answered 4 days ago in GCP by Sirajul
• 29,340 points
9 views
0 votes
1 answer

Permissions issue with Google Cloud Storage Bucket.

You can regain access to the object by assigning an applicable role, like roles/storage.objectAdmin, to ...READ MORE

answered 3 days ago in GCP by Sirajul
• 29,340 points
8 views
0 votes
1 answer

Does Google cloud platform (GCP) offer IaaS ? Or just PaaS?

GCP provides IaaS as well, although it ...READ MORE

answered Sep 20 in GCP by Sirajul
• 29,340 points
50 views
0 votes
1 answer

How do I create a VPCN (Virtual private cloud network) on Google Cloud?

You can connect various GCP resources to each ...READ MORE

answered Sep 23 in GCP by Sirajul
• 29,340 points
13 views