Keep wp-content/uploads urls for SEO

To keep the image rankings but use the /app/uploads/ after migration, I use this NGINX location block:

location /wp-content/ {
    rewrite ^/wp-content/(.*)$ /app/$1 permanent;
}

You can test any of the /wp-content/ links, they should all perfectly redirect to the new location.

4 Likes