WordPress.org

Ready to get started?Download WordPress

Forums

Download Monitor
Multisite works on main domain but not on child domains (5 posts)

  1. AJ Troxell
    Member
    Posted 2 years ago #

    Using download monitor on all three of my sites. On the main site, the parent site, the root domain for multisite, downloads work find out of the box, and of course to get downloads to work for the child sites, i have to enter this into download.php

    //for multisite	installations
      if ( is_multisite() ) {
       $path = '/wp-content/blogs.dir/' . $blog_id . '/' . $path;
     }

    But what this does is break downloads on the parent/root site and allows them to work on the child sites. Is there any way for both to work that anyone has found?

    http://wordpress.org/extend/plugins/download-monitor/

  2. wrk
    Member
    Posted 2 years ago #

    checking if this is the root or child site solves the problem:

    if(is_multisite() && 1 != $blog_id ){
    
    	$path = 'wp-content/blogs.dir/' . $blog_id . '/' . $path;
    
    }

    If you use a Custom Download URL (for example: yoursite.com/download/ID), make sure you add the following to your .htaccess under the download plugin section:

    RewriteRule ^([_0-9a-zA-Z-]+/)?download/([^/]+)$ /wp-content/plugins/download-monitor/download.php?id=$2 [L]

    NOTE: assuming you use the subfolder setup for the multisite!

    Hope this helps

  3. Anicetix
    Member
    Posted 2 years ago #

    But what if I'm using the subdomain instalation?

  4. AJ Troxell
    Member
    Posted 2 years ago #

    Using the subdomain setup has always been hit or miss on my end. I personally would suggest the subfolder setup and using a domain mapping plugin to change it to a subdomain or primary domain. Its not perfect but it works.

  5. KZeni
    Member
    Posted 1 year ago #

    I can confirm that @wrk's fix works when using this plugin on a multi-site install that uses separate domains. I've posted it to github in hoping that it might get patched in.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic