WordPress.org

Ready to get started?Download WordPress

Forums

Adding a file to root directory of Multi site (KML) (15 posts)

  1. clange33
    Member
    Posted 1 year ago #

    Can anyone assist me with adding a file (KML/XML) to the root directory of a MU site? I have about 25 sites and I need to be able to add a kml file to the root directory of each site.

    I have added it to the path /web/wp-content/blogs.dir/16/files but then the permalink structure is mysite.com/files/locations.kml. I need it to be mysite.com/locations.kml.

    Does anyone know a solution or a plugin that will fix? I've been getting really frustrated with this and can't find any solution.

  2. I have added it to the path /web/wp-content/blogs.dir/16/files but then the permalink structure is mysite.com/files/locations.kml. I need it to be mysite.com/locations.kml.

    You can put it in files and then use .htaccess to redirect.

    RewriteRule ^locations.kml /files/locations.kml [L,R=301]

  3. clange33
    Member
    Posted 1 year ago #

    Thanks for your help, but that didn't seem to work. When i went to the URL mysite.com/location.kml it redirected to the wrong one mysite.com/files/location.kml. Do i put the file in a different folder?

    Also I need to add XML files (mysite.com/sitemap.xml & mysite.com/geositemap.xml).

    Is there another way to do it?

  4. clange33
    Member
    Posted 1 year ago #

    When I try and validate it on Google maps search the error comes up. The URL needs to be mysite.com/locations.kml.

  5. Try

    RewriteRule ^locations.kml /files/locations.kml [L]

    Keep in mind, what you said was you had a file in mysite.com/files/location.kml and you wanted it to be accessed by mysite.com/sitemap.xml ... What didn't work about that? Even google knows what a redirect is.

  6. clange33
    Member
    Posted 1 year ago #

    The code works, it redirects properly, but when I test it on Google Maps I am getting an error message. Is there any other way to do it?

  7. The second code I gave shouldn't redirect... How are you testing in google?

  8. clange33
    Member
    Posted 1 year ago #

    When you search the file in Google Maps mysite.com/locations.kml I get the error message "could not be displayed because it is not a valid KML or KMZ file." other sites that I have that aren't MU work just fine.

  9. clange33
    Member
    Posted 1 year ago #

    Maybe it would work if you can make it an actual URL destination instead of automatically downloading the kml similar to http://mjwmedia.com/locations.kml. Perhaps that would work? Is there a way to do that?

  10. Even if it's in files, it shouldn't download the file when accessed. I checked with Google Maps and they don't care where the file is located on your server.

  11. clange33
    Member
    Posted 1 year ago #

    When I search at https://maps.google.com/ I get the error message. All my other sites work great. Is there an other code that will make this work?

  12. Can you give me a real URL?

  13. clange33
    Member
    Posted 1 year ago #

  14. clange33
    Member
    Posted 1 year ago #

    mjwmedia.com/locations.kml isn't Mu, nassausuffolklawyer.com is MU I believe that is the issue.

Topic Closed

This topic has been closed to new replies.

About this Topic