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.
Oct 9, 2019 in GCP by Sam
• 5,030 points
51 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 Oct 9, 2019 by Sirajul
• 45,590 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 Oct 10, 2019 in GCP by Sirajul
• 45,590 points
33 views
0 votes
1 answer

Can I give a user access to cloud storage who doesn't have a GCP account?

Yes, you could certainly do this.  You can ...READ MORE

answered Nov 5, 2019 in GCP by Sirajul
• 45,590 points
50 views
0 votes
1 answer
0 votes
1 answer

GCP Error: 403: Access Denied

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

answered Oct 9, 2019 in GCP by Sirajul
• 45,590 points
58 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 Oct 10, 2019 in GCP by Sirajul
• 45,590 points
207 views
0 votes
1 answer
0 votes
1 answer

How to create a Google Cloud Filestore instance?

Create an instance by running the instances create command, ...READ MORE

answered Oct 23, 2019 in GCP by Sirajul
• 45,590 points
51 views
0 votes
1 answer