skip to Main Content

I migrated my wordpress website into my local machine, but it’s redirecting me to the original ,-server one-, website, immediately after I opennig the local one.

I try to describe what did I do as detailed as much I can:

  • First I got all wp files and copied-d it to my local XAMPP htdocs directory via SHH (FROM Linux Debian 10 – Apache 2 Webserver).
  • After that I exported the database (exported to sql file format).
  • I created the same database and user (with the same permissions as the server db user) in the local webserver
  • Everything went successfully, but after i want to open http://localhost/ I got redirected to my old site like https://originalsite.com

What did I tried to solve the problem:

  • I checked Apache, PHP and phpmyadmin version, but these are the same.

  • I reinstalled XAMPP but that also didn’t solve the problem.

  • I checked wp-config.php but there aren’t any options I’ve could been change, php.ini and my.ini both of them not gave me any alternative.

Thanks!

2

Answers


  1. In the .sql file you imported, find “site_url” and change it to localhost URL. Or you can define it in wp-config.php file as “WP_SITEURL

    Login or Signup to reply.
  2. You will need to manually go in Database and Replace LIVE site URL with the Local URL.
    Something like:

    https://originalsite.com/
    TO
    http://localhost/originalsite
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search