0

I would like to use google cloud platform to host my website (some files with only html and some files with php). But it only shows the index.html page without any images and all the link are not working. I think my app.yaml file is not correct.

Case background:

  • I am using google cloud sdk in my mac.
  • gcloud app deply (this is the command to deploy my website)

Here with app.yaml file:

runtime: php55
api_version: 1

handlers:

- url: /.*
  script: index.html

enter image description here

Kara
  • 6,115
  • 16
  • 50
  • 57
GPH
  • 1,111
  • 6
  • 29
  • 49

1 Answers1

1

You need to add static_dir or static_files elements to handlers in your app.yaml.

Using static_dir, for example:

runtime: php55
api_version: 1

handlers:

- url: /
  script: index.html
- url: /images
  static_dir: images
dhauptman
  • 974
  • 7
  • 14
Christopher P
  • 1,108
  • 7
  • 8
  • thank you for your answer, but I follow what you did for the images. It doesn't work. I only put 1 jpg file in the images folder. My website is working properly in cpanel server. It only has problems in google cloud. I think my app.yaml file is not correct. – GPH Nov 27 '18 at 15:54
  • I have edited the answer with the full example. Removing the " .* " from url field worked for me. If still doesn't work can you share your index.html file? – dhauptman Dec 05 '18 at 09:49