Many time you will notice that when you are accessing a WordPress URL it is being redirected to some other domain, it’s quite frustrating sometimes, here are the following methods through which you can solve this issue.
Method 1: Examine redirection rules in the .htaccess file.
- Open .htaccess file from the site root folder
- Detect the redirection code, if you find any redirection code just delete it and save the changes.
Method 2: Modify the wp-config.php file.
- Open wp-config.php file from site root folder.
- Detect the below line.
define( 'WP_SITEURL', 'https://www.example.com')
define( 'WP_HOME', 'https://www.example.com');
You just have to replace this URL to the actual one.
- Save the changes you have made.