I’m using the entire Roots stack for the new version of my site. I’m developing using a new fork of my production database. The site is quite large so I wanted to add rewrite rules to swap app/uploads for my production uploads url.
What is the best course of action to do so? I’ve searched quite a bit here and saw some were using htaccess and some are using wp-h5bp-htaccess. I’m having a hard time finding clarity on which method to use.
If you’re using the entire stack, I don’t think .htaccess will do anything; Trellis is using nginx, not Apache. For things like images, you should be able to do something like this, which basically “falls back” to an external URL if it can’t find things locally:
That does assume that you’re referencing assets without the domain and scheme (i.e. you’re doing /asset.jpg not https://site.com/asset.jpg) and that your asset paths aren’t different between production and development (which, if you’re using Roots, they shouldn’t be).
My current production site is not part of the Roots stack and uses Apache. I’m building the new version completely separate and currently all development is local.
Am I able to swap upload urls even though the environments are different?
My current production asset urls are: https://domain.com/wp-content/uploads/
Where does that code snippet reside? Thanks for all your patience and help.