Fetch Media from Production or Staging Server
For local development and testing you do not have to copy all media files to your local environment.
The following redirect or proxy directives will load all media and thumbnail files not available locally from a staging or production server.
When using apache (webserver-type: apache-fpm
) add these lines at the beginning of your public/.htaccess
file:
Do not commit this updated public/.htaccess file to your repo.
When using nginx (webserver-type: nginx-fpm
), create a file .ddev/nginx/media-redirect.conf
with the following contents (with optional basic auth):
The nginx way obviously has the advantage that it can be committed to your repository and, once setup, doesn't need any further attention.
Last updated
Was this helpful?