I have my Wordpress site installed on a root folder. Then I have a test subdirectory where I want to have a copy of my website. I did copy and move all of the files from my main website to the test directory. I have created a new database, a new user, imported the database from the main website into the new database and I have changed the wp_confing.php file in the test directory to use that new database. Everything seems to be ok but when I got to: mainwebsite.com/test/wp-admin and I try to log in, it just hangs there, I press on access and I get no error or anything, the password fields just resets but I don't get redirected so I cannot save my permalinks.

I suspect an error in the .htacces file, since its' the same from the main website, but then I deleted it and I still have the same problem.

up vote 1 down vote accepted

If it's a standard WordPress .htaccess file that won't be your problem. I'm willing to bet you forgot to change the Site URL values when you imported the database.

You can either edit it in the options table in your database or even in your wp-config file by adding

define('WP_HOME', 'http://mainwebsite.com/test');
define('WP_SITEURL', 'http://mainwebsite.com/test');

to it. You can read more (or other ways to do it) here: https://codex.wordpress.org/Changing_The_Site_URL

  • Oh that was it! I forgot, thank you so much. Accepting when it allows me. – Sergi Feb 27 at 23:24
  • We've all certainly been there, such a simple thing to forget in a migration. I'm glad to help! – Xhynk Feb 28 at 0:01

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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