Can you check the wp-config.php
file and make sure it’s not being set by the WP_HOME
and/or the WP_SITEURL
constants?
If you set the WP_HOME
and WP_SITEURL
constants in the wp-config.php
file to webinar.example.test
, but have the home
and siteurl
options in the wp_options
table set to staging.webinar.example.org
, then running the wp option get siteurl
command would return the value of the siteurl
option in the wp_options
table, which is staging.webinar.example.org
.
The WP_HOME
and WP_SITEURL
constants in wp-config.php
are used to override the home
and siteurl
options in the wp_options
table. However, if the WP_HOME
and WP_SITEURL
constants are not set or are set to the same values as the home
and siteurl
options in the wp_options
table, then the wp option get siteurl
command will return the value of the siteurl
option in the wp_options
table.
If that doesn’t solve the problem, then there are a few possible reasons why your WordPress site is being redirected to webinar.example.test even though the siteurl and home values in the database are correct.
Here are some possible causes and solutions:
- If you are using a caching plugin, it may be caching the old URL and
redirecting to it. Try clearing the cache and see if that fixes the
issue. - If you are using a CDN, it may be caching the old URL and redirecting
to it. Try clearing the CDN cache and see if that fixes the issue. - If you have any custom code that is modifying the site URL, it may be
using the old URL and redirecting to it. Check your custom code and
see if you can find any references to the old URL. - If you have any custom DNS records that are redirecting to the old
URL, it may be causing the redirect. Check your DNS records and see
if you can find any references to the old URL.
If none of these solutions fix the issue, you may need to further investigate the cause of the redirect. You can try using the wp_redirect_status
filter hook to see which URL the site is being redirected to.
Here is an example:
function custom_redirect_status($status, $location, $code) {
error_log("Redirect: $location ($code)");
return $status;
}
This code logs the redirect URL and status code to the error log. You can then check the error log to see which URL the site is being redirected to. This can help you identify the cause of the redirect and find a solution.