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:
-
Open the Cloud Storage browser in the Google Cloud Platform Console.
-
Click the Activate Cloud Shell button at the top of the Google Cloud Platform Console.
-
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.
-
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.
Hope it works!!
If you want to become a professional Google Cloud Architect, Its recommended to go for the certification course first.
Thanks!