Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirect local media references to an existing production site #822

Open
dabowman opened this issue Jan 20, 2025 · 0 comments
Open

Redirect local media references to an existing production site #822

dabowman opened this issue Jan 20, 2025 · 0 comments
Labels
[Type] Feature Request A shiny new thing

Comments

@dabowman
Copy link

What

I would love to be able redirect media references in a local environment to a corresponding production site. This would allow me to develop new features for an existing site without needing to download all of the sites /uploads directory. Basically what WordPress VIP allows with their local dev environment https://docs.wpvip.com/vip-local-development-environment/add-media-content/

Why

Developing features for an existing site is much easier if you can have an up-to-date copy of the site's database and media in the local environment. The database isn't usually too big, but the media can frequently be huge. Needing to download all of that for local development is a huge pain and takes up a lot of hard drive space. Just redirecting references to the local environment's uploads directory to the url of the existing production site lets you have access to the media in your local environment without needing to download everything.

How

To use the wpvip dev environment as an example, when an existing database is synced to a local dev environment, a search and replace is performed to replace references to the production site url with the url of the local environment. At this time, the user can define a media redirect URL—usually the url of the existing production site. If a reference to a media file in the local environment returns a 404—because the uploads directory wasn't downloaded—it will be redirected to the url provided by the user as the media redirect url, connecting it to the media hosted on the live production site.

@dabowman dabowman added the [Type] Feature Request A shiny new thing label Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Feature Request A shiny new thing
Projects
None yet
Development

No branches or pull requests

1 participant