Support » Fixing WordPress » Redirect from one wp-admin to other

  • Hello. I created wp site on subdomain of one of my sites. The problem is that I’m trying to get in adminboard of another site and it redirects me to that new site.
    I asked techsup of my hosting and we came to the point that it’s not about IP’s.
    I checked .htacess file it’s default, dunno what to do else.

Viewing 15 replies - 1 through 15 (of 16 total)
  • @olegantr

    Thanks for asking! I think I understand what you mean, but I’m not sure. Could you post a link to the site so I can see what happens?

    I’m trying to go in corelyrics.cx/wp-admin but it redirects me in coin.financein.ru/wp-admin (the site I created 2 days ago. I didn’t write anything in wp files or smth)
    https://imgur.com/a/Pzepy

    • This reply was modified 3 weeks, 6 days ago by  olegantr. Reason: link edit

    I will try to describe more accurately if necessary. Or gonna give more screens.

    @olegantr

    Thank you for writing back.

    Google searching on this term:
    "wp-login.php?redirect_to=" wp-admin" "reauth=1"

    , comes up with links to forums and threads that seem like they are people with very similar issue, and, they have some suggestions there such as trying disabling plugins temporarily, or turning on debug and looking for clues in the debug output.

    Some of the forums linked from that google search results also suggested looking into the .htaccess file too, and you said that you started to do that once already.

    What do you think of trying some of those other suggestions (i.e. disabling plugins, or trying debug output)?

    Will you then again write an update back here to let us know how you go?

    Regards,

    Morgan

    Thank you for respone, Morgan.
    How can I disable plugins without getting into admin console? I disabled plugins in my new site and nothing change. And what is debug output how can I turn it on or where to find it?

    @olegantr

    Thank you for writing back.

    Other ways to deactivate plugins:

    “How to deactivate all plugins when not able to access the administrative menus?”
    https://codex.wordpress.org/FAQ_Troubleshooting#How_to_deactivate_all_plugins_when_not_able_to_access_the_administrative_menus.3F

    Write us back to let us know how you go?

    Thanks for ideas but it doesn’t help unfortunally 🙁 Is there something, anything else what might be work?

    @olegantr

    Hi, thanks for writing back.

    See the bottom of this post for the short “tl;dr” version.

    I was able to reproduce the same symptom, by modifying my wp-login.php file, reloading the page, loading the wp-login.php page, logging in and out of WordPress.

    To line 406 ( https://core.trac.wordpress.org/browser/trunk/src/wp-login.php?rev=40954#L406 ) of my wp-login.php, I added this line:

    update_option('siteurl', 'http://coin.financein.ru' );

    It then manifested the symptom whereby pointing my browser to my wp-admin folder
    ( “http://localhost:7888/mzz-woo-wp/wp-admin”)

    , caused it to land on:
    (“http://coin.financein.ru/wp-login.php?redirect_to=http%3A%2F%2Flocalhost%3A7888%2Fmzz-woo-wp%2Fwp-admin%2F&reauth=1”)

    I was able to then again fix the symptom by a again modifying the wp-login.php file back to the original value, reloading the page, loading the wp-login.php page, logging in and out of WordPress.

    I switched line 406 to say:
    update_option('siteurl', 'http://localhost:7888/mzz-woo-wp' );

    When reloaded the page, loaded the wp-login.php page, logged in and out of WordPress, now it acts as expected.

    the short “tl;dr” version

    In short, here’s what I’m suggesting you do. What happens if you update line 406 of wp-login.php to:
    update_option('siteurl', 'http://corelyrics.cx' );

    , and then reload the page, loaded the wp-login.php page, and log in and out of WordPress?

    Does that fix the symptom?

    Will you please write back to let us know how you go?

    (p.s. afterwards, don’t forget to take that line out of line 406 of the wp-login.php, becasuse after it does its job, that line won’t be needed any longer)

    • This reply was modified 2 weeks, 2 days ago by  mjassen (mjjojo). Reason: add tl;dr designator
    • This reply was modified 2 weeks, 2 days ago by  mjassen (mjjojo). Reason: fixed the suggested siteurl recommendation

    Hi! Many thanks for reply!
    I tried this the way you suggest.

    Now it changes to:
    (url is correct but anyway can’t login in cx)
    https://imgur.com/a/PCbaR
    and now I login to coin.finance.ru admin console with corelyrics.cx adress
    https://imgur.com/a/XdpAa

    @olegantr

    Thanks for writing back, with an update and with the screenshots.

    I agree something still doesn’t sound right — I want to figure out why the “Back to…” (“Назад к сайту…”) link is pointing back to the coin.financein.ru site.

    This should be set in the home option_name in the database.

    What does your database setup look like? ( for the database that is running the corelyrics.cx site )

    If you are able to query the database, if you query the corelyrics.cx site’s database for the home opion_name, then what do you see?

    Like:
    SELECT * FROMwp_optionsWHEREoption_nameLIKE 'home'

    For example:
    2017 08 07 1030 login trouble

    Other than that, we could try the hammer approach (try to fix it before fully understanding it), by doing the same trick as before, but this time forcing the home option, like so:
    update_option('home', 'http://corelyrics.cx' );

    Will you write us back again afterwards with an update of how it goes?

    I tried to do this (probably wrong). Now nothing works.

    Can I transfer “corelyrics” site to new DB? I don’t wanna lose all the posts from cx site but I dont cate atm about new site (“coin.finance”).

    @olegantr

    Thanks for writing back.

    I’m sorry that it’s not better and that there’s still trouble.

    For reference, here’s what it looks like when I view it now. (four screenshots, from the front end and from the wp-login.php page, for each of the sites (corelyrics and coin.financein.ru, respectively )

    corelyrics.cx screenshot:
    2017 08 14 1029 corelyrics

    corelyrics.cx/wp-login.php screenshot:
    2017 08 14 1029 corelyrics wp login

    coin.financein.ru screenshot:
    2017 08 14 1029 coin financein

    coin.financein.ru/wp-login.php /wp-login.php screenshot:
    2017 08 14 1029 coin financein wp login

    @olegantr , what does your database setup look like? ( I mean, can you post a description of it, or a screenshot?) (especially the values of home and siteurl from the database)

    I tried to do this (probably wrong)

    Will you explain what did you try?

    Hello, Morgan!
    http://imgur.com/k4YszHK
    http://imgur.com/l13N9U6
    that’s how it looks
    I tried to put the code you post to my database.
    Maybe sites are on the same user in database (cannot remember that). is this coulda be reason of this troubles?

    @olegantr

    Thanks for writing back, and for the database screenshots.

    To find out what database each site is on, you could, for each of the two websites, if you look in the site’s wp-config.php file, the line starting with:
    define('DB_NAME...
    , will tell you what database that site’s using.

    Will you post back here to let us know what you discover?

    Regards,
    -Morgan

    Thanks again. Tomorrow I’ll let you know what I discover.

Viewing 15 replies - 1 through 15 (of 16 total)
  • You must be logged in to reply to this topic.