WordPress.org

Ready to get started?Download WordPress

Forums

Share files/media between subdomain and main site (4 posts)

  1. colegota
    Member
    Posted 3 years ago #

    Hi!

    I've been reading this similar thread having a related problem and maybe you can give me any idea to deal with.

    In short: a plugin needs to use a text file to work. I use the plugin at subdomain blog with an media uploaded txt file and this is replicated via mu-sitewide-tags plugin to main blog and there file seems not to be accessible to main blog post.

    In detail:

    .- I'm using OSM Plugin to use maps on posts. This plugin use txt file to put a second layer on map with gps/kml tracks, thumbnails...

    .- This is the subdomain post:
    http://colegota.mapamundi.info/2009/07/13/marcadores-en-los-mapas-con-openstreetmap-plugin/
    It uses file http://colegota.mapamundi.info/files/2010/12/egon-marcadores.txt uploaded previously to multimedia library.

    .- If you see the post from a main blog page like a category page it can't find txt file and can't show track and photos in map. Example:
    http://mapamundi.info/seccion/campamento-base/

    Before migrate to multisite I have that files under colegota.mapamundi.info/gpx/... or similar folders and replicated post in main blog using syndication, then were no problem. But now, with WP managing * subdomains, subfolders are not accessible.

    Any ideas?

    Regards,
    Colegota

  2. Subfolders should still be accessible. If you manually make a subfolder called gpx, then it will be available at *.yourdomain.com/gpx (where * is whatever your subdomain is).

    I use that functionality in some weird stuff :)

    I would not upload it to the media library unless I had to, as those are per-site and (as of today) cannot talk to each other.

  3. colegota
    Member
    Posted 3 years ago #

    Subfolders should still be accessible. If you manually make a subfolder called gpx, then it will be available at *.yourdomain.com/gpx (where * is whatever your subdomain is).

    Thanks Ipstenu, you are right! But this is messy. :(

    I did worked at my test site pedrezuela.net and created a gpx folder so I put the file at public_html/gpx/egon-400.gpx Then it's true its accessible via http://colegota.pedrezuela.net/gpx/egon-400.gpx and http://pedrezuela.net/gpx/egon-400.gpx also. But if I pass the subdomain URL to the plugin, then it works at subdomain post but not at main page replicated post, and if I pass the domain URL to the plugin it works in main page but not at subdomain.

    I supposed then it's related to plugin. I'll try to contact again with his developer.

    Examples at:
    .- Original post at subdomain: http://colegota.pedrezuela.net/2011/01/19/prueba-marcadores/
    .- Category page at main replicated blog: http://pedrezuela.net/seccion/campamento-base/

    This is the code passed to the plugin
    [osm_map lat="-8.642" long="122.424" zoom="12" width="600" height="450" type="CycleMap" gpx_file="http://colegota.pedrezuela.net/gpx/egon-400.gpx"]

    When it works (now at subdomain) you'll see a blue line on map with the GPS trace.

    Regards,
    Colegota
    PD I forget to say that there is a previous similar question one month ago. But then I've using RSS syndication and now I've changed to wordpress-mu-sitewide-tags.

  4. colegota
    Member
    Posted 3 years ago #

    Found a little hack by now.

    As Ipstenu said, domain directories are visible to subdomains, and after my previous test seems that visibility depends on where you are at the moment of the reference. So if you are watching post from main domain you need url belongs to main domain and if you are reading posts from subdomain, url must contain subdomain.

    Then a solution it's to edit main domain post just after created the subdomain one. Then remove the subdomain reference at url.

    If you need to use the file sample.gpx, you upolad it to public_html/gpx/sample.gpx, and use it as http://subdomain.domain.com/gpx/sample.gpx at subdomain post (the original one).

    Then access main domain admin->posts and edit the replicated one removing "subdomain." from url having http://domain.com/gpx/sample.gpx and then it works both in domain and subdomain pages.

    The only drawback it's that every time you updated posts at subdomain you need to fix url again at main domain. But that's not so usual.

    Well, it's not perfect but can be useful while we found a better solution.

    You can test it at my site. You must see blue lines (tracks) at the maps at posts, both at domain and subdomain:

    http://mapamundi.info/tema/plugin-osm/
    http://colegota.mapamundi.info/tema/plugin-osm/

    Regards,
    Colegota

Topic Closed

This topic has been closed to new replies.

About this Topic