Edit functions.php
To be certain your WordPress site is pointing to the correct URL do this.
- Got to your themes functions.php file found at /wp-content/themes/
theme-name
- Add these two lines to the file, immediately after the initial
<?php
line.
update_option( ‘siteurl’, ‘http://example.com‘ );
update_option( ‘home’, ‘http://example.com‘ );
- Make sure you clear all cache and if using CloudFlare, put it into development mode.
-
Check you have no redirects in your
.htaccess
files -
Now check to see if your site points to the correct URL.
If it doesn’t it’s likely you have a DNS setting that needs changing. Check your parked domains to make sure one isn’t set as a redirect there as seen in the WHM setting I have on my server in the below image.
*Once you have solved the issue, it’s a good idea to remove your added code from functions.php
. If you don’t you won’t be able to change these settings in the WordPress setting until you do so.