• Resolved cking0987

    (@cking0987)


    I’m in the process of preparing for a website migration from one host to another. This plugin works great on the live site, but not on the new host. I’m wondering if this could in any way be related to the fact that I haven’t yet switched the DNS over to point to the new host? I’m using an override in my local hosts file to prep and test the new site. I’ve turned off all caching, and triple-checked all my config options. They are exactly the same between the two sites. I’ve even tried uninstalling/reinstalling the plugin. It doesn’t seem like something that should be related to DNS but I have no idea what else it could be? Any help would be greatly appreciated.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Robert Peake

    (@robertpeake)

    Sorry, I’m just not aware of anything domain-specific about the plugin. Are the URLs in the admin correct?

    Thread Starter cking0987

    (@cking0987)

    Thanks for responding! Yes, both the WordPress and Site URLs are set to https://www.mydomain.com (I’m using ‘mydomain’ instead of the real one).

    In Better Random Redirect, the main randomizer URL field is set to exactly e/message-board, so the full randomizer URL is https://www.mydomain.com/e/message-board/

    In my hosts file, I have the following two entries:
    ##.###.##.### www.mydomain.com
    ##.###.##.### mydomain.com

    When I visit https://www.mydomain.com/e/message-board/ on the new host, it just stays at https://www.mydomain.com/e/message-board/. I can navigate directly to any of the posts by going to https://www.mydomain.com/e/message-board/post-slug

    In Better Random Redirect, category is set to “All Categories”, Cache time is set to 300, and I’ve tried all the available different post types. The page is just not triggering a redirect. Is there any sort of debugging I can do to see if the plugin is even being called?

    • This reply was modified 2 years, 9 months ago by cking0987.
    • This reply was modified 2 years, 9 months ago by cking0987.
    • This reply was modified 2 years, 9 months ago by cking0987.
    Thread Starter cking0987

    (@cking0987)

    I wanted to give an update here. I found some errors in php_errorlog that are related to this:

    [25-Feb-2022 23:46:46 UTC] WordPress database error Table 'dbguye3dg3xeok.wp_posts' doesn't exist for query SELECT ID FROM wp_posts where post_type='external_posts' and post_status='publish' and post_password = '' made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), do_action('template_redirect'), WP_Hook->do_action, WP_Hook->apply_filters, BetterRandomRedirect::do_redirect

    The reason this is failing is because my table prefix is not set to “wp_”. I think if I could completely remove and reinstall Better Random Redirect, the plugin might be able to figure out the correct table prefix. Is there a way to do this? When I delete/reinstall, BRR keeps my configuration settings. How do I completely remove all of it? Alternatively, is there a way to force a re-index or something?

    Plugin Author Robert Peake

    (@robertpeake)

    Good detective work. The plugin does indeed cache the query post type, so if your prefix changed that could be the issue.

    You need to delete two options to have them regenerate with the correct post type prefix:

    brr_query_posttype_pattern
    brr_query_posttype_category_pattern

    Hope that helps!

    Thread Starter cking0987

    (@cking0987)

    It works!!! Thank you so so so much. I know you aren’t actively supporting this plugin anymore, so I really appreciate your help.

    For anyone else that might have the same issue, here are the steps I took:
    1. Deactivate and remove the Better Random Redirect plugin
    2. Run the following 2 commands in wp-cli:
    wp option delete brr_query_posttype_pattern
    wp option delete brr_query_posttype_category_pattern
    3. Install Better Random Redirect. Note: your configuration options will remain unchanged, but the internal cache will have been reset, resulting in the redirect functioning properly.
    `

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Issues related to DNS records?’ is closed to new replies.