5

I have a WordPress site hosted on GoDaddy, it's a Windows server, (i have the web.config set up). and .htaccess correctly configured. The site was working on example.com/wordpress , as it was a development test. I moved the site to example.com .

I changed the site url and wordpress URL to example.com on the database through PhpMyAdmin, and updated the permalink structure.

I also updated all the wp_post 'content' field to change the URL's.

Issue

When I try to Log In to the admin panel through example.com/wp-admin, the URL shows as

example.com/wp-login.php?redirect_to=http://example.com/wordpress/wp-admin/reauth=1

Why could this be happening if both the site url and wordpress url match, and match with the database.

Additional Notes

This isn't a cache issue (At least not on the browser's side), I have tried different browsers, and I do most of the testing on incognito chrome windows.

I have tried setting update_optionfor both siteurl and home in functions.php and:

//wp-config.php
define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');

I also tried the Relocate Method explained on the Codex http://codex.wordpress.org/Changing_The_Site_URL

3
  • Do you see correct URLs showing in Settings > General?
    – Rarst
    Commented Nov 4, 2013 at 9:39
  • Yes. It displays both URLs as the new one. (example.com) Commented Nov 4, 2013 at 10:39
  • Were you able to solve this case? Last solution would be to reinstall in root.
    – Azghanvi
    Commented Jan 9, 2023 at 8:08

3 Answers 3

9

I had the same issue. To fix it I had to make some changes to the database. Use phpMyAdmin or just log directly into the database and look at your wp_options table. Check the following two fields: siteurl and home.

SELECT * FROM wp_options WHERE option_name IN ('siteurl', 'home');

Make sure these fields hold the correct domain information if not change them and see what happens. In my case the issue was resolved.

3
  • 2
    My wordpress instance has those fields set to the proper URL however the html source on login page is still has <input type="hidden" name="redirect_to" value="http://localhost/wp-admin/"> at the end .. Commented Jan 27, 2019 at 22:56
  • This is how you modify the entries; update wp_options set option_value = replace(option_value, "old website url", "new website url");
    – Sy Ker
    Commented Mar 2, 2022 at 11:09
  • 1
    Does not work. Still redirecting to old development link
    – Azghanvi
    Commented Jan 9, 2023 at 8:07
1

I was able to solve a similar issue using the wp command line tool. I had to use the command line tool because I was unable to login to Wordpress admin with my browser.

wp @mysitestage config set WP_HOME "https://stage.mysite.com/"
wp @mysitestage config set WP_SITEURL "https://stage.mysite.com/blogdir"
0

I solved this by installing a login URL change plugin: https://wordpress.org/plugins/wps-hide-login/

I needed this security feature as well.

1
  • Adding a description to this comment will help this not look like a spam marketing comment. Also, please explain how this plugin you are recommending solves the issue the OP described. Commented Mar 29, 2023 at 19:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.