Here in this tutorial, we will explain to you how to troubleshoot redirecting issues 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.
- Login to your WordPress admin panel.
- Once logged in, navigate to the Settings page and click General Settings.
- 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.
- 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 the same.
- Login to your cPanel.
- Click on File Manager and then go inside public_html.
- Check for a .htaccess file outside as well as inside of public_html.
- Open the .htaccess file and check for the redirection rule which will be something like shown below.
You can simply remove this if not required.
- Login to your cPanel.
- Click on File Manager and go inside public_html.
- Now go to your WordPress installation folder and find the 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’).
- 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 troubleshooting at the 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.
- To remove the rule, click the Delete button (x icon) and confirm it by clicking OK.
- So now that you know how to troubleshoot redirection in your WordPress website, I guess it will now be easy for you to get the problem resolved.
Check for some redirect codes in the index.php file. Sometimes index.php is also responsible for the redirection of the website. So if such code is present inside the index.php file, simply remove it if not required.
If these all troubleshoot didn’t work in your case, then you need to search for something like the “redirect” keyword in the 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
If you have any queries, feel free to let us know via the comments section below.