From 542d815268512ce9575585d62dbf1c8396937f84 Mon Sep 17 00:00:00 2001 From: Ivan Blagdan Date: Sun, 18 Aug 2024 16:32:59 +0200 Subject: [PATCH 1/3] Adding an example of how you could redirect media uploads requests to a different domain --- .../redirect-upload-requests/blueprint.json | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 blueprints/redirect-upload-requests/blueprint.json diff --git a/blueprints/redirect-upload-requests/blueprint.json b/blueprints/redirect-upload-requests/blueprint.json new file mode 100644 index 0000000..f472fc2 --- /dev/null +++ b/blueprints/redirect-upload-requests/blueprint.json @@ -0,0 +1,20 @@ +{ + "$schema": "https://playground.wordpress.net/blueprint-schema.json", + "meta": { + "title": "Pretty permalinks", + "description": "Set the permalink structure to use pretty permalinks.", + "author": "bgrgicak", + "categories": ["Settings"] + }, + "landingPage": "/category/uncategorized/", + "constsnats": { + "PLAYGROUND_REDIRECT_UPLOADS_URL": "https://production.example.com" + }, + "steps": [ + { + "step": "writeFile", + "path": "/wordpress/wp-content/mu-plugins/redirect-uploads.php", + "data": " Date: Tue, 17 Sep 2024 07:53:40 +0000 Subject: [PATCH 2/3] Added blueprint metadata for redirec-upload-requests. --- blueprints/redirect-upload-requests/blueprint.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/blueprints/redirect-upload-requests/blueprint.json b/blueprints/redirect-upload-requests/blueprint.json index f472fc2..16b4b7b 100644 --- a/blueprints/redirect-upload-requests/blueprint.json +++ b/blueprints/redirect-upload-requests/blueprint.json @@ -1,13 +1,13 @@ { "$schema": "https://playground.wordpress.net/blueprint-schema.json", "meta": { - "title": "Pretty permalinks", - "description": "Set the permalink structure to use pretty permalinks.", - "author": "bgrgicak", + "title": "Redirect upload requests", + "description": "Redirect any requests to files within the uploads directory to an external host. This is useful when you have a lot of image attachments in your playground but don’t want to include them all in the blueprint.", + "author": "ivanblagdan", "categories": ["Settings"] }, "landingPage": "/category/uncategorized/", - "constsnats": { + "constants": { "PLAYGROUND_REDIRECT_UPLOADS_URL": "https://production.example.com" }, "steps": [ From d5ff13a8102a7472fd4e2d922a3ddbdb5acf083a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Zieli=C5=84ski?= Date: Tue, 24 Sep 2024 14:36:01 +0200 Subject: [PATCH 3/3] Update blueprints/redirect-upload-requests/blueprint.json --- blueprints/redirect-upload-requests/blueprint.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blueprints/redirect-upload-requests/blueprint.json b/blueprints/redirect-upload-requests/blueprint.json index 16b4b7b..f94fb51 100644 --- a/blueprints/redirect-upload-requests/blueprint.json +++ b/blueprints/redirect-upload-requests/blueprint.json @@ -1,7 +1,7 @@ { "$schema": "https://playground.wordpress.net/blueprint-schema.json", "meta": { - "title": "Redirect upload requests", + "title": "Serve media files from another host", "description": "Redirect any requests to files within the uploads directory to an external host. This is useful when you have a lot of image attachments in your playground but don’t want to include them all in the blueprint.", "author": "ivanblagdan", "categories": ["Settings"]