WP Hive » Troubleshooting and How-To

sitemap.xml, robots.txt do not redirect

(7 posts)

Tags:


  1. pkonink
    Member

    Hi, I've been using wp-hive for about a week now and I really like it alot. Everything has worked perfectly - until today.

    Well, everything still works fine - I just can't get robots.txt and sitemap.xml (and I would assume favicon though I haven't tried it) to show up properly.

    I am able to reach them by typing in (i.e.) http://xxx.com/wp-content/wp-hive/xxx.com/robots.txt but http://xxx.com/robots.txt returns a 404 error. Interestingly it does not return the wp 404.php page (as I noticed from the hive plugin it is supposed to), but a regular server message.

    I am at a loss right now, but I'll keep looking. Hopefully someone will have an idea about what is wrong.

    I am using a Cpanel shared hosting account. I have wordpress set up in its own directory (public_html/wp_base) and point new domains to it for hive.

    With each domain I use two .htaccess files for redirects, one in wp_base and one in Cpanel-created domain directory.

    I use the public_html/wp_base/.htaccess to rewrite the subdomain to the main domain (i.e. xxx-user.domain.com to xxx.com) and the public_html/xxx-user/.htaccess to rewrite out the www site dupe (www.xxx.com rewrites to simply xxx.com).

    I'm not sure if this could affect how hive handles the extra files, but I thought it worth mentioning in case. So far I have had no other problems with redirection or url rewriting in hive.

    EDIT: I suppose I could add a .htaccess rewrite to get the bots to the right place, but I would prefer to have hive do it automatically. If I find a solution I will post it here, hopefully someone else can see what I am missing.

    Posted 3 years ago #
  2. pkonink
    Member

    UPDATE: Still haven't figured it out, but I found one thing that might anyone else pondering this problem.

    Somehow the 404.php is not set up properly or is not working. I just noticed it when I forced a 404 to check the output for something else.

    I am going to look for a solution soon on this, but what I posted above about hive not showing the 404.php page either is not due to hive or at least it is not because of or limited to the sitemap and robots functionality of hive.

    EDIT: I just "solved" the 404 problem. Well, I didn't solve it at all, I just rigged it with my trusty old .htaccess file by adding in

    ErrorDocument 404 /index.php?error=404

    to it. I wish I knew why WP isn' handling it right, though I suspect it has something to do with my install WP to a subdirectory. I'll keep looking I guess.

    Posted 3 years ago #
  3. pkonink
    Member

    Apparently sitemap.xml and robots.txt are working now. The only thing I changed was the addition of the aforementioned ErrorDocument line in my public_html/.htaccess and public_html/wp_base/.htaccess files.

    Does something on the web server take time to be updated? I don't see why adding ErrorDocument would change anything, or could it?

    Posted 3 years ago #
  4. pkonink
    Member

    OK, now it doesn't work again. The only thing I changed was to add a new site to the hive.

    Looking more at this ... I think there is a problem with hive rewriting, as I have confirmed that xxx.com/index.php?sitemap=1 (as well as simply xxx.com/sitemap=1) work correctly. The same holds true for the robots.txt file (i.e. .../index.php?robots=1).

    Or maybe it is a caching problem? I had a temporarily setup blog in the hive for testing and the same sitemap.xml I am getting for all other blogs in the hive are for it. But I deleted that temp blog and it's directory under /wp-hive/, so the sitemap.xml does not exist. I even deleted all its tables out of my database. But it is still being read from somewhere and all other blogs are pointed to it for some reason.

    I'll check a few more things and report back.

    OK, right after I wrote that I checked my base wp directory and there was a sitemap.xml and .xml.gz sitting in there. I deleted them but now I get a server 404 for the xxx.com/sitemap.xml URL (not a wp 404.php error). I'll keep looking and come back again.

    Posted 3 years ago #
  5. pkonink
    Member

    OK, it works again now. The only thing I did was re-upload my .htaccess file for my wp_base/ directory.

    I am still at a loss, though. Even if my .htaccess file(s) are being tampered with by the server or Cpanel, there is nothing in them regarding the sitemap or robots files. Perhaps there is some sort of caching involved that needed a coupe minutes to refresh?

    Here is my .htaccess fwiw:

    RewriteEngine On
    RewriteBase /
    # xxx1.com
    RewriteCond %{HTTP_HOST} ^xxx1-user\.xxx0\.net$
    RewriteRule ^(.*)$ http://xxx1.com/$1 [R=301,L]
    # xxx2.com
    RewriteCond %{HTTP_HOST} ^xxx2-user\.xxx0\.net$
    RewriteRule ^(.*)$ http://xxx2.com/$1 [R=301,L]
    # BEGIN WordPress
    ErrorDocument 404 /index.php?error=404
    # END WordPress

    (the names of the domains have been changed obviously.)

    Posted 3 years ago #
  6. ikailo
    Developer

    WordPress caches the permalink rewrites on some servers. It is possible that the WP Hive rewrites have not made it into the cache yet.

    Try this:
    1. Ensure the wp-hive plugin is activated
    2. Go to Settings > Permalinks options page
    3. Click "Save Changes"

    This forces WP to re-enter the rewrite rules into the Database.

    Posted 3 years ago #
  7. pkonink
    Member

    A ha! Thanks for this info, it is exactly what I have been wondering. And you were right on the money, the permalink-save trick worked perfectly. Thanks a lot!

    Posted 3 years ago #

RSS feed for this topic

Reply

You must log in to post.