Puddinq.com sharing knowledge

Use production uploads on local development

Use production uploads on local development

in your .htaccess

Just serve everything from production (add to .htaccess in root)

RewriteCond %{REQUEST_URI} ^/content/uploads/[^\/]*/.*$
RewriteRule ^(.*)$ https://www.puddinq.nl/$1 [QSA,L]

Or place in .htaccess in uploads folder to only look for files in production that do not exist in development

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^.*$ https://www.puddinq.nl%{REQUEST_URI} [L,R=302]

or your nginx

    # Try uploads locally, otherwise redirect to live website.
    location /content/uploads {
        try_files $uri @redirectUploads;
    }

    # Redirect upload file to the live website.
    location @redirectUploads {
        return 302 https://www.puddinq.nl$uri;
    }