1

I need to create a copy of a WordPress in a local environment.

I have alread done some research and

  1. Included the following line in wp-config.php (at it's start, also tried at the end)

    define('WP_SITEURL','http://mydomain.local'); define('WP_HOME','http://mydomain.local');

Note sure if these URLs should be different.

  1. Changed siteurl and home to http://mydomain.local in database in table [prefix]_options

  2. I have also checked the .htaccess file and it contain nothing that refers to the online domain.

but it keeps redirecting me to the online domain.

3
  • Do you have anything in your htaccess file (redirects) or any sort of redirect plugin? Commented Apr 8, 2019 at 15:38
  • Good question, I had already checked .htaccess (but forgot it when writing my question), it has nothing that refers to the online domain), regarding plug-ins, I guess I need to ask this to the person who administrated the WP.
    – TTT
    Commented Apr 8, 2019 at 15:43
  • 2
    Possible duplicate of WordPress localhost site redirect to live site
    – leymannx
    Commented Apr 8, 2019 at 17:31

1 Answer 1

0

Clear all rewrite_rules in the wp_options table in your database then open your local website in an incognito browser or clear your browser cache.

4
  • How do you clear rewrite rules?
    – TTT
    Commented Apr 8, 2019 at 16:17
  • Go to your database in PHPMYADMIN go to wp_options find rewrite_rules and delete all the values out of it Commented Apr 8, 2019 at 16:17
  • That's the first thing I tried, I just don't see anything called "rewrite_rules"
    – TTT
    Commented Apr 8, 2019 at 16:19
  • 1
    There’s multiple pages of fields in wp_options check the box to show all and then search for rewrite_rules Commented Apr 8, 2019 at 16:21

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