To deploy a specific folder on Google App Engine (GAE) for WordPress, you can follow these steps:
- Create a new folder inside your WordPress project directory and move the files you want to deploy into that folder. For example, if you want to deploy the
wp-content/uploadsfolder, you could create a new folder called
uploadsand move the contents of the
wp-content/uploadsfolder into it.
- Create an
app.yamlfile in the root directory of your WordPress project. This file is used to configure the GAE deployment.
- Inside the
app.yamlfile, add the following configuration:
runtime: php55 api_version: 1 handlers: - url: /uploads static_dir: uploads
This configuration tells GAE to serve the files in the
uploads folder as static content.
- Open the Cloud SDK command prompt and navigate to the root directory of your WordPress project.
- Run the following command to deploy your project to GAE:
gcloud app deploy
This command will upload your entire WordPress project to GAE, but only the files in the
uploads folder will be served as static content.
- Once the deployment is complete, you should be able to access the files in the
uploadsfolder at the URL
By following these steps, you can deploy a specific folder on GAE for WordPress while keeping the rest of your project files private.
Last modified: March 3, 2023