• Hi,
    I’ve been scouring google for a fix for this. In my subdirectory NEW (4.1+) WordPress Multisite, media library links in sites are not working. I can upload in any site in my network in their respective media libraries but those images show as broken after uploading and show the master site domain name in the url link (which I also do not want).

    I am new to Multisite Networks and started my first network a month ago.
    I did not notice this issue before because I’ve been using a Google Drive plugin for my media libraries so that all images are on Google Drive.

    In the last few days I wanted to upload some files to the sites directly and that’s when I found this issue which is common for older installations which have been upgraded.

    Here’s my .htaccess file:

    [ Moderator note: code fixed. Please wrap code in the backtick character or use the code button. ]

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    </IfModule>
    <FilesMatch "^.*(error_log|wp-config\.php|php.ini|\.[hH][tT][aApP].*)$">
    Order deny,allow
    Deny from all
    </FilesMatch>
    # END WordPress

    `
    I am using plugin WordPress MU Domain Mapping to assign a domain name to each sub directory site.

    Far as I can tell, everything else is working except media library links where files are uploaded directly from the non-master sites to their own media libraries.

    Thank you for any help

    I have been reading the forums since this issue comes up alot, but many are for older installations from before 3.5 having upgraded to 4.0+. I didn’t start with blog.dir, my installation started with the sites directory structure.
    Also permalinks did work beforehand and are set to post names in all sites.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter LevyImage

    (@levyimage)

    I just want to check, I found this link: https://wordpress.stackexchange.com/questions/73783/broken-image-multisite

    So since I’m not on blog.dir structure…
    And assuming I have to manually add a rewrite rule for every site in the main .htaccess file?? Should I use something like this or is there a better fix?

    # uploaded files
    # domain 2
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-content/uploads/sites/2/files/$2 [L]
    # domain 3
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-content/uploads/sites/3/files/$2 [L]

    etc etc for each domain? But my site files are stored in uploads/sites/n/date of post… format… date being year/month.
    So how do I make this all work right? thank you

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    I’ve been scouring google for a fix for this. In my subdirectory NEW (4.1+) WordPress Multisite, media library links in sites are not working. I can upload in any site in my network in their respective media libraries but those images show as broken after uploading and show the master site domain name in the url link (which I also do not want).

    Can you give us the broken URL and a working version there of?

    I did not notice this issue before because I’ve been using a Google Drive plugin for my media libraries so that all images are on Google Drive.

    It’s POSSIBLE that’s what’s breaking it ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WordPress Multisite Mapped Subdirectory Sites Media Links Broken’ is closed to new replies.