Title: Links missing subfolder on Multisite
Last modified: August 24, 2016

---

# Links missing subfolder on Multisite

 *  [captaincrash](https://wordpress.org/support/users/captaincrash/)
 * (@captaincrash)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/links-missing-subfolder-on-multisite/)
 * I have a Multisite subfolder install and in the links shown in the dashboard 
   widget the subfolder of the current site is missing. So, instead of
    [http://multisite.tld/site-b/content-link](http://multisite.tld/site-b/content-link)
   the widget shows [http://multisite.tld/content-link](http://multisite.tld/content-link)
   which, of course, leads to a 404. Any ideas?
 * A small related questions:
    In a Multisite environment the plugin only shows 
   stats for the respective site. Site A cannot see data for Site B, is that correct?
 * Thanks in advance.
 * [https://wordpress.org/plugins/statify/](https://wordpress.org/plugins/statify/)

Viewing 10 replies - 1 through 10 (of 10 total)

 *  Thread Starter [captaincrash](https://wordpress.org/support/users/captaincrash/)
 * (@captaincrash)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/links-missing-subfolder-on-multisite/#post-6055411)
 * Btw, the visual link is ok the way it is (showing only “/content-link”), but 
   the actual href is broken.
 *  Thread Starter [captaincrash](https://wordpress.org/support/users/captaincrash/)
 * (@captaincrash)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/links-missing-subfolder-on-multisite/#post-6055886)
 * The problem is within widget_front.view.php on line 44. Outputting the target
   URL should add the `home_url()` back to it, like so
 * `<a href="<?php echo home_url( esc_url($target['url']) ); ?>" target="_blank"
   >`
 * `home_url()` returns the correct subfolder site in a multisite environment.
 * As a side note, the sanitization of the referrer URL doesn’t take domain mapping
   into account. The check `strpos( $referrer, home_url() ) === false )` should 
   maybe compare `$referrer` and `$target`, too – not just `home_url()`, as this
   returns the unmapped multisite URL.
 * Thoughts?
 *  Anonymous User 7658014
 * (@anonymized_7658014)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/links-missing-subfolder-on-multisite/#post-6055887)
 * [@captain](https://wordpress.org/support/users/captain/).crash I’m not the author,
   but I think this might be worth an [issue at the GitHub repo](https://github.com/sergejmueller/statify/issues).
   Would you mind? 🙂
 *  Thread Starter [captaincrash](https://wordpress.org/support/users/captaincrash/)
 * (@captaincrash)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/links-missing-subfolder-on-multisite/#post-6055889)
 * Also, line 74 within `statify_frontend.class.php` doubles the subfolder of a 
   multisite install, because `$target` already contains the subfolder via `$_SERVER['
   REQUEST_URI']` and `home_url()` adds it again.
 * `$data['target'] = home_url($target, 'relative');`
 * Overall, it seems the plugin is not multisite ready, although it claims to be.
 * [@caspar](https://wordpress.org/support/users/caspar/): You’re probably right
   and I’ve looked there before, but since there is only one issue by the plugin
   author himself, I decided to post it here, where much more activity appears.
 * If only I could find the checkbox that hides my posts from the plugin author’s
   view…
 *  Anonymous User 7658014
 * (@anonymized_7658014)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/links-missing-subfolder-on-multisite/#post-6055890)
 * You sound like you know what you’re doing, so don’t be shy posting an issue there!
   🙂 Decent collaboration is always welcome, I’m sure.
 *  Thread Starter [captaincrash](https://wordpress.org/support/users/captaincrash/)
 * (@captaincrash)
 * [10 years, 12 months ago](https://wordpress.org/support/topic/links-missing-subfolder-on-multisite/#post-6055965)
 * [@caspar](https://wordpress.org/support/users/caspar/): Sergej told me, you and
   him would have a look. Any news on this?
 *  Anonymous User 7658014
 * (@anonymized_7658014)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/links-missing-subfolder-on-multisite/#post-6055966)
 * I don’t no of any news on this issue, but I’ll gladly help creating an according
   GitHub issue, so we can finally resolve it. Can the problem be summarized like
   the following?
 * _In a multisite environment, links inside the dashboard widget pointing to sub-
   sites are currently broken. They should use `home\_url()` as well as domain mapping
   into account._
 *  Thread Starter [captaincrash](https://wordpress.org/support/users/captaincrash/)
 * (@captaincrash)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/links-missing-subfolder-on-multisite/#post-6055967)
 * Yes, that pretty much sums it up.
 * A simple example complementing my posts 3. and 5. above. Let’s say
 * `http://domain.com/subsite/testpage`
 * gets mapped to
 * `http://subsite.com/testpage`
 * BUT links to the frontend within the admin area stay unmapped!
 * Statify only saves the absolute path in the DB `/testpage` – which is ok, I guess.
 * Currently, the admin widget links to just `/testpage` which results in
 * `http://domain.com/testpage` (missing `/subsite`)
 * but should prefix `/testpage` with `home_url()` to make it
 * `http://domain.com/subsite/testpage`
 * And, see side note in post 3. above, clicking from the admin on
 * `http://domain.com/subsite/testpage`
 * which gets mapped to
 * `http://subsite.com/testpage`
 * currently qualifies as a valid stat entry since referrer and target don’t share
   the same domain, however, these cases should not get logged.
 * Thanks again.
 *  Anonymous User 7658014
 * (@anonymized_7658014)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/links-missing-subfolder-on-multisite/#post-6055971)
 * We’re working on the issue, will post updates here soon. Would you be willing
   to test any results once we’re done?
 * [https://github.com/pluginkollektiv/statify/issues/9](https://github.com/pluginkollektiv/statify/issues/9)
 *  Thread Starter [captaincrash](https://wordpress.org/support/users/captaincrash/)
 * (@captaincrash)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/links-missing-subfolder-on-multisite/#post-6055972)
 * Absolutely.

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Links missing subfolder on Multisite’ is closed to new replies.

 * ![](https://ps.w.org/statify/assets/icon-256x256.png?rev=2355063)
 * [Statify](https://wordpress.org/plugins/statify/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/statify/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/statify/)
 * [Active Topics](https://wordpress.org/support/plugin/statify/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/statify/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/statify/reviews/)

## Tags

 * [multisite](https://wordpress.org/support/topic-tag/multisite/)
 * [subfolder](https://wordpress.org/support/topic-tag/subfolder/)

 * 10 replies
 * 2 participants
 * Last reply from: [captaincrash](https://wordpress.org/support/users/captaincrash/)
 * Last activity: [10 years, 11 months ago](https://wordpress.org/support/topic/links-missing-subfolder-on-multisite/#post-6055972)
 * Status: not resolved