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.

closed as off-topic by Jacob Peattie, rudtek, bosco, cjbj, shea Apr 24 at 7:38

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions that are too localized (such as syntax errors, code with restricted access, hacked sites, hosting or support issues) are not in scope. See how do I ask a good question?" – Jacob Peattie, rudtek, bosco
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Do you have anything in your htaccess file (redirects) or any sort of redirect plugin? – Alexander Holsgrove Apr 8 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 Apr 8 at 15:43
  • 2
    Possible duplicate of WordPress localhost site redirect to live site – leymannx Apr 8 at 17:31
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.

  • How do you clear rewrite rules? – TTT Apr 8 at 16:17
  • Go to your database in PHPMYADMIN go to wp_options find rewrite_rules and delete all the values out of it – Daniel Vickers Apr 8 at 16:17
  • That's the first thing I tried, I just don't see anything called "rewrite_rules" – TTT Apr 8 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 – Daniel Vickers Apr 8 at 16:21

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