WP Hive » Installation and Configuration

google sitemap issue when sharing same tables

(7 posts)

  1. lakong
    Member

    I'm trying to use wp hive in a little different way then most. Once I set up my sites I modify the hosts table to have all sites point to the same place. This is idea for me because my physical post entries actually read custom XML Files that we have created on a different server so the content is unique to each site via the XML.

    Anyway, everything works great except for one thing. Google sitemaps only works for one site since I need to point it at one directory. Does anyone know a work-around for this? Is there some way I can get it to create sitemaps for each of my hive sites?

    I would be happy to pay for custom work if that's what is required.

    Thanks!

    Posted 3 years ago #
  2. ikailo
    Developer

    I'm not sure I understand how you have the hosts table. Can you give an example?

    Posted 3 years ago #
  3. lakong
    Member

    I have all of the prefixes set to the same value, so all sites share the same table. I think the easiest thing would be to use a third-party product to generate the sitemaps outside of WP. If I did this and I stored the sitemaps in the /wp-hive/sitename.com directories, would your plugin redirect calls for http://www.sitename.com/sitemap.html to appropriate subdirectory under /hp-hive

    While I have you, a few more quick questions:

    1) I have mentioned this in the past, but haven't gotten an answer. Everytime I add a new site to the hive, my permalinks get broken and I have to resave the permalink option. Is there a way around this? It's not that big of a deal with my setup since I only have to do it once since I'm sharing the same DB. It is a real pain in other hive instances since I have to login to each site and resave the permalinks.

    2) performance -- I have noticed a real hit to performance at times on hive sites, when compared to non-hive installations. What would be the reason for this? Is there some settings I can make in WP or in my OS to improve performance?

    3) When checking the wphive-hosts table I'm noticing a few entries from other domains that I didn't make. There are no new tables setup for these sites, just entries in the hosts table. Any idea how they got there? Is there a way to prevent this?

    Thanks!!!

    Posted 3 years ago #
  4. lakong
    Member

    I meant share the same tables -- I erase the tables for each new site and just tell WP to use the same tables. In truth, the posts all appear unique because my posts use simple-pie to read RSS that is specific to each site. I append a variable to the rss filename so each site reads different files.

    Posted 3 years ago #
  5. ikailo
    Developer

    Ok, about the sitemap. If you generate static sitemap files, then yes, wp-hive will read them properly if they are stored in the correct directory - /wp-content/wp-hive/domain.com/sitemap.xml. I think the question you need to address is how to get them stored in the proper location. If you use the google-sitemap-generator plugin, then I think I've figured out a hack to make it work in your case. Let me know if you want me to send it to you.

    Other Answers:

    1. At this point, I don't know of any other way to refresh the rewrite rules. This might be a question for a different group. I believe the issue may involve .htaccess.

    2. I can't think of any reason why there would be a performance hit. In reality, there are only a couple additional db calls when the page starts loading. I'd be interested to know if anyone else notices any performance changes.

    3. You should remove the extraneous records and set 'allow_new_hosts' to '0' in the 'wphive_config' table. I do recommend this for all installations, unless you are adding a new site to the hive. I've noticed that some servers forward requests for hosts with characters added (like a . at the end of the domain), and WP Hive interperets it as a new domain. The latest release attempted to resolve this.

    Posted 3 years ago #
  6. lakong
    Member

    Thanks so much for the answers. I will probably generate the sitemaps outside of WP but would like to try the hack if you can send it. Feel free to email to tworags@gmail.com. Two other issues, that you may be able to help me with:

    1) relative links: since WP writes full links with complete paths in the HTML and bases it off of the siteurl setting in the DB, when I share the tables I need to rewrite all URL's to remove or replace the domain name. For now I have written some plugin functions to do it, but it is a bit of a pain since my templates use lots of different function to display links in various places. Is there some way you can think of to trick WP into using a different URL for the siteurl?

    2) using Hive AND using another Hive DB on an external server: I want to use the same DB that I'm sharing with my Hive sites for a second Hive installation that resides on a different server. I have been able to get the permissions working in MySQL to allow a wordpress site on a different server to attach to it remotely, but have not gotten it to work if I want to share the same tables (like I'm doing now in the Hive). Any ideas what I need to be aware of?

    Thanks again!

    Posted 3 years ago #
  7. lakong
    Member

    I found a thread that discusses how to make some minor hacks in order to share most of the same tables but not ALL of the same tables. Basically I would have each site use a unique options table and just share common tables like users, posts, meta data, categories, etc. This way they all have their own plugin tables, I don't have any issues with site name, etc. I tried doing it, but I'm thinking that the hive might need some special treatment. The thread is at:

    http://software.jonandnic.com/hack/wordpress-hacking-multiple-blogs-on-one-set-of-tables-2

    The top suggestions are for an older version, but if you look down they suggest modifying wp-db.php as follows:

    Anyway, in Wordpress 2.5 you need to edit the wp-db.php file in the wp-includes directory. In the function set_prefix($prefix) section, you can override the settings. Following

    foreach ( $this->tables as $table )
    $this->$table = $this->prefix . $table;

    the code should look like this:

    $this->posts = ‘wp_’ . ‘posts’;
    $this->users = ‘wp_’ . ‘users’;
    $this->categories = ‘wp_’ . ‘categories’;
    $this->post2cat = ‘wp_’ . ‘post2cat’;
    $this->links = ‘wp_’ . ‘links’;
    $this->postmeta = ‘wp_’ . ‘postmeta’;
    $this->usermeta = ‘wp_’ . ‘usermeta’;
    $this->terms = ‘wp_’ . ‘terms’;
    $this->term_taxonomy = ‘wp_’ . ‘term_taxonomy’;
    $this->term_relationships = ‘wp_’ . ‘term_relationships’;

    Any idea how to get it to work when using your stuff?

    - Scot

    Posted 3 years ago #

RSS feed for this topic

Reply

You must log in to post.