Support » Plugin: Redirection » http://www.example.com redirects to /wp-admin/

  • Resolved zviera

    (@zviera)


    Hi,

    the default domain format I am using on my client’s site is https://example.com. WordPress should automatically redirect to that domain format, when someone goes to:
    https://www.example.com (this works as expected)
    http://example.com (this works as expected)

    But when someone goes to http://www.example.com, for some reason it redirects to https://example.com/wp-admin/, which then of course redirects to the login page wp-login.php.

    This happens only when your plugin Redirection is active. It also happens after I deactivated all my redirects, which are setup with your plugin, so the issue is not caused by regular expressions.

    We have Let’s Encrypt certificate installed and we were using Really Simple SSL plugin. After I have found out about this issue, we have tried using another plugin – WP Force SSL. The issue happens with both plugins, when your plugin is installed, but also when the SSL plugins are deactivated.

    Do you have any idea why this happens? Google is not happy with the current situation since it can’t access the http://www version of the site now.

    Thank you.

    Lubo

    The page I need help with: [log in to see the link]

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author John Godley

    (@johnny5)

    A few people have reported the same problem in exactly the same situation, but when I try and investigate the problem disappears. There is nothing in the plugin to redirect to wp-admin.

    I can see the behaviour when I access your site, and I can also see that Redirection is not causing the redirect. I don’t know why the problem disappears when you disable Redirection.

    Does it happen if you disable Really Simple SSL?

    Do you have any kind of cache setup?

    Thread Starter zviera

    (@zviera)

    Hi John,

    thanks for the quick reply.

    Yes, it does happen even when Really Simple SSL is disabled.

    Yes, we use WP Super Cache, but it does happen even with the plugin disabled.

    Thanks.

    Lubo

    Ok. I may be close to solution?

    I had same issue. After hour or so I found that is Redirection plugin fault for sure. Same issue. After turning off plugin everything was fine.

    When i turn it on it was mess again.

    I tried with several custom new redirection but that wasn’t a real solution. After deep searching I found somewhere suggestion that issue can be connected with SSL.

    So what I did. I unchecked this option “Force a redirect from HTTP to HTTPS. Please ensure your HTTPS is working before enabling (beta)” (https://prnt.sc/mf8ffn), cleaned cache and everything started working again.

    What is weird that after uncheck and reload page this option is checked again… But solution for now working.

    I believe that it could be some kind of conflict between this plugin and Really Simple SSL… Please check if that “solution” working for you too!

    🙂

    Thread Starter zviera

    (@zviera)

    Thanks @siergiejpoz for the suggestion. I have actually switched to another plugin, since I needed this resolved quickly. I am not using Redirection anymore.

    @zviera

    As I understood plugin change solved all your issues? If yes can you give me plugin name which you used as alternative in case that my solution won’t work permanent?

    Thread Starter zviera

    (@zviera)

    @siergiejpoz Yes, I have used the plugin “Safe Redirect Manager” and the issue is gone since. That plugin also supports regular expressions, which I needed, and other plugins couldn’t handle it.

    @zviera Thank you 🙂

    Plugin Author John Godley

    (@johnny5)

    I’m sorry you had problems with this plugin and had to go elsewhere. As I mentioned above, I have never been able to investigate this. If anyone does want to try again I’d be more than willing to try and dig deeper into the site to try and figure out what is happening.

    Thread Starter zviera

    (@zviera)

    @johnny5 I have sent you a message through your website.

    hyphendigital

    (@hyphendigital)

    Have been experiencing the same issue with a client site, exactly as described.

    Issue:
    http://www.myurl.com/page → https://myurl.com/wp-admin (or wp-login.php)

    Debug:

    1. Disabled Redirection. The above works as expected (though showing non-SSL URL)
    2. Enabled Redirection. Turned Force HTTPS on. Same issue as described above
    3. Turned Force HTTPS off. Works as described in Step 1.

    Had a look in the Redirection plugin code, to see how the HTTPS redirect was done, and in modules/wordpress.php on line 96 in the force_https function, the wp_safe_redirect function is used to redirect to the requested URL, forcing HTTPS:

    wp_safe_redirect( 'https://' . $target, 301 );

    This function is found in pluggable.php, line 1277-1311, and it actually has a fallback to the Admin URL when it considers the the new URL to not be valid, and runs through a filter to validate and determine if the new URL is safe or not.

    This seems to be where the issue lies — WordPress considers the URL its given as not safe, and reverts to the fallback URL which is the admin URL.

    I’m not sure how to fix — but should hopefully aid the plugin developer in debugging/tracking down the issue!

    Plugin Author John Godley

    (@johnny5)

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘http://www.example.com redirects to /wp-admin/’ is closed to new replies.