• I have set up a multisite with folder structure and I’m using define( 'UPLOADS', ''.'media' ); in wp-config.php to set a custom media library path. All multisite configuration is working well except the use of media on any of the subfolder sites.

    I can upload media and the correct path for the image is saved, for example https://domain.com/subfolder/media/sites/2/2020/01/filename.png. This path is similar to the default path when not adding a custom media library path. It would then be https://domain.com/subfolder/wp-content/uploads/sites/2/2020/01/filename.png. But where it works with the default path the images give a “too many redirects” error when using a custom path.

    So it seems to me that rewriting the path to media files on subsites is not working correctly when using a custom media path. I’m using the default .htaccess config as suggested by the network installer. It looks like this:

    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]

    How can I get multisite with subfolder and custom media path to play nice together?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Defining UPLOADS location on multisite results in “too many redirects”’ is closed to new replies.