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:
- 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.
- 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. - Check wp-config.php: Make sure that the
WP_SITEURLandWP_HOMEvariables are correctly set in thewp-config.phpfile 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'); - Clear Cache: Clear your browser cache and cookies. Sometimes browsers cache the redirection and it can cause unexpected behavior.
- 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
- 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 differente from 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!
