You could achieve this with environmental variables for the different environments, as long as Strapi is aware and you have a migration script to change the pathing in the database.
I am unsure why you would want to change it between environments though.