0

TLDR:

I want to do some work on a WP, but not on the live version (www.mysite.com), so I cloned it to a subdirectory www.mysite.com/new. Now I am trying to access it, but I get redirected to www.mysite.com/news/ - news page of the original WP.


Here are the steps I took:

  • copied index.php and wp folder to /new folder
  • created new database and imported everything from the original one
  • changed wp_config.php of the cloned WP to reflect database changes (different DB name and hostname, different password)
  • now, when trying to access www.mysite.com/new, I get redirected to www.mysite.com/news/, which is the news page of the original WP

Here is the root directory of FTP:

enter image description here

and here is the new directory:

enter image description here

I know I might need to replace the permalinks with database search and replace script, but at this stage I am at least expecting to see the cloned WP with links pointing to the original WP, not a redirect to news page.. What am I doing wrong and how do I fix it?

1

Remove the htaccess file and then regenerate it by hitting save at settings->permalinks

Also make sure to change site_url and home (options table), to reflect the updated path.

P.S.: You should really have a local dev env.

  • Where do I find Settings->Permalinks? At the original WP control panel? Please note that the original WP must stay the same. – Primož Kralj Dec 1 '17 at 14:29
  • No, go into "new/wp/" and delete htaccess. Then try accessing yourdomain.com/new/wp/wp-admin ... you'll probably be able to login. Also don't forget to set the new database url to yourdomain.com/new/wp – Daniel Fonda Dec 1 '17 at 14:31
  • I was able to access /new/wp/wp-login.php, but after logging in, I get redirected to the original admin panel (www.mysite.com/wp/wp-admin/). – Primož Kralj Dec 1 '17 at 14:36
  • Ok, that means you didn't update your database (wp_options table) site_url and home to your updated url as I've instructed. – Daniel Fonda Dec 1 '17 at 14:38
  • wp_options table didn't have these entries, but I did put define('WP_HOME','siteurlbutSOisblockingit/new/'); (same for WP_SITEURL) in wp-config.php. Now I can access the cloned WP but it is without any styles. Sorry to bother so much, but do you have any clue? – Primož Kralj Dec 1 '17 at 14:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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