Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi there,

    It looks like there might be a redirection issue or a misconfiguration causing the login page of the blog site to redirect to the main site’s login page. Here are a few steps you can try to resolve the issue:

    1. Check .htaccess file: Sometimes, redirection issues can be caused by rules in the .htaccess file. Check the .htaccess file in the root directory as well as in the /blogs/ subdirectory to see if there are any redirection rules that may be causing this issue.
    2. Check Plugins: If you are using any security plugins or redirection plugins, they might be causing the issue. Temporarily deactivate all plugins by renaming the plugins folder to something else (e.g., plugins_old) via FTP or File Manager in your hosting control panel and see if that resolves the issue. If it does, you can reactivate plugins one by one to find out which one is causing the problem.
    3. Check wp-config.php: Make sure that the WP_SITEURL and WP_HOME variables are correctly set in the wp-config.php file for your blog instance. It should look something like this for the code:
      define('WP_HOME','https://www.datanumen.com/blogs'); define('WP_SITEURL','https://www.datanumen.com/blogs');
    4. Clear Cache: Clear your browser cache and cookies. Sometimes browsers cache the redirection and it can cause unexpected behavior.
    5. Manually Access the Login Page: Try accessing the login page directly by typing in the full URL: https://www.datanumen.com/blogs/wp-login.php
    6. Check Server Configuration: If your server is running on Nginx, check the configuration file for any redirection rules. If you are on a shared hosting, contact your hosting provider for assistance.

    These are the possible causes that I could think of.

    Best regards,

    Christopher Amirian

    Thread Starter chcw

    (@chcw)

    Hi, @christopheramirian

    Thank you for so many solutions. I tried some of them. And finally find out the real reason, which is a bit tricky:

    I install Redis Object Cache on both instances, while they both connect to the same Redis server on the local computer. Then it seems the query to the cache will not differentiate which site it make the query, so when the cache contains the data for the main site, the request from the blog site will return the main site data.

    So, what I do is, flush the cache in the main site, then stop it. Then I can login the blog site properly, then I disable the cache in the blog site. And then restart the cache in the main site, since main site is more important than the blog site.

    That’s all!

    • This reply was modified 1 year, 5 months ago by chcw.

    Perfect! Thank you for sharing ??

    Thread Starter chcw

    (@chcw)

    You are very welcome.

    Also for those who encounter the same issue, by using the following statement in wp-config.php can prevent conflict between multiple instances:

    // change the prefix and database for each site to avoid cache data collisions
    define( 'WP_REDIS_PREFIX', 'my-moms-site' );
    define( 'WP_REDIS_DATABASE', 0 ); // 0-15

    Use WP_REDIS_PREFIX if you put the tables of all instances in one database. Use WP_REDIS_DATABASE if you use multiple databases, for 0 to 15. As long as two database use different number, they will not conflict with each other.

    I use both as being scared by the confliction results.

    For more details, see https://github.com/rhubarbgroup/redis-cache/blob/develop/INSTALL.md

    • This reply was modified 1 year, 5 months ago by chcw.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Blog site login always redirect to main site login’ is closed to new replies.