How to troubleshoot Redirecting issue in WordPress website?

Hello,

Here in this tutorial we will explain you how to troubleshoot redirecting issue in your WordPress website.

Let me tell you that if you are facing any kind of redirection issue in your WordPress site then it is most probably due to some misconfigured redirection rule placed inside your hosting account. With the help of this article you will know how to troubleshoot redirect issues in your WordPress website.

Troubleshoot 1.

Login to your WordPress admin panel

Once logged in, navigate to the Settings page and click General Settings.

How to troubleshoot Redirecting issue in WordPress website

When on the General Settings page, you will notice there is a list of settings and available options. Double-check and ensure that both, the WordPress and Site addresses, match.

How to troubleshoot Redirecting issue in WordPress website

If there is a mismatch between the two URLs (e.g. the WordPress Address is set to http://mydomain.com/, but the Site URL points to http://www.mydomain.com/), you need to make sure that both web addresses are same.

Troubleshoot 2.

Login to your cPanel

Click on File Manager and then go inside public_html

Check for .htaccess file outside as well as inside of public_html

Open the .htaccess file and check for redirection rule which will be something like shown below

How to troubleshoot Redirecting issue in WordPress website

You can simply remove this if not required.

Troubleshoot 3

Login to your cPanel

Click on File Manager and go inside public_html

Now go to your WordPress installation folder and find wp-config.php file

Open wp-config.php file and check your script for the following two global variables – define( ‘WP_HOME’, ‘http://www.mydomain.com’ ); and define( ‘WP_SITEURL’, ‘http://www.mydomain.com’).

How to troubleshoot Redirecting issue in WordPress website

Please verify that the WP_HOME address matches the WP_SITEURL hostname in the code.

Troubleshoot 4.

If your domain is using Cloudflare, then you also need to do some troubleshoot at CloudFlare panel as well by checking the existing page rules.

Login to your Cloudflare account

Select the domain where you want to edit your page rule.

Now locate the rule to Edit

How to troubleshoot Redirecting issue in WordPress website

To remove the rule, click the Delete button (x icon) and confirm it by clicking OK

So now that you know how to troubleshot redirection in your WordPress website, i guess it will now be easy for you to get the problem resolved.

Troubleshoot 5.

Check for some redirect codes in index.php file. Sometimes index.php is also responsible for redirection of the website. So if such code is present inside the index.php file, simply remove it if not required.

If these all troubleshoots didn’t worked in your case, then you need to search for something like “redirect” keyword in whole cPanel by following the below tutorials

SSH level >> https://blog.redserverhost.com/how-to-find-a-keyword-under-whole-public-html-via-ssh/

cPanel level >> https://blog.redserverhost.com/how-to-find-a-keyword-under-whole-public-html-via-cpanel-user-level-access/

If you enjoyed this tutorial, please consider following us on Facebook and Twitter.

Facebook Page- https://facebook.com/redserverhost
Twitter Page- https://twitter.com/redserverhost.com

If you have any query, feel free to let us know via the comments section below.