I recently moved all my blogs into a single WordPress Multisite installation. However, I know have the problem that media links are broken – not only in some of my blog posts, but also across the internet whereever I embedded images from my media library.
This is the regular URL
http://mydomain.com/wp-content/uploads/2013/12/filename.gif
This is the URL after installing MU:
http://mydomain.com/wp-content/uploads/sites/2/2013/12/filename.gif
where the following are variable:
http://mydomain.com/wp-content/uploads/sites/[siteID]/[year]/[month]/[filename].[ext]
Is it possible to fix this problem with htaccess URL forwarding and regular expressions? How exactly would the htaccess command and the regular expression look like? (Unfortunately I’m somewhat illeterate when it comes to regex)…
This should work for you.:
If the url doesn’t contain
wp-content/uploads/sites/2/
then it will add thesites/2/
to the url