wordpresshttp-redirect

Wordpress - Prevent redirection to main URL


I tried to copy the files of a WordPress website on another domain of mine. But it keeps redirecting to the old domain name.. I'm not a WordPress expert and it's also not my website - that's why I don't have a GUI and only the files.

How and where can I disable the redirection to the main domain in the files? I can't seem to find it.

Thanks for the efforts.

For example:

WordPress website "test.com" copy paste --> "testtest.com"

"testtest.com" redirects to --> "test.com" when entered in URL


Solution

  • When you transfer a Wordpress install to a new domain, there are 2 values you need to update in your database, in the wp_options table. One is the home option and the other is the siteurl. Typically these changes would be made directly in the database, either by modifying the SQL file before importing it on the new server or by accessing the database using PHPMyAdmin or some other form of database management software. However, in the event that you don't have access to the database or do not want to make the change in the database, you can also override the settings in your wp-config.php file using the following options:

    define('WP_HOME','https://yourdomain.com');
    define('WP_SITEURL','https://yourdomain.com');