The redirect problem in any web browser is not easy to solve if you’re new to blogging, or if you set up a website for the first time. But, when you look inside the website configurations and some other things, you will easily fix the problem.
Today, I will show you how to fix the problem “This Webpage Has a Redirect Loop“, when you want to access your website homepage, or any other Url from Google Chrome, Firefox or any other browser.
The redirect loop problem appears, in general, when you migrate your website to a new server. And of course, you’ve missed something to add, or to edit after moving your files.
In WordPress, for example, users forget to install their blog with the full domain name, if the old installation includes the “www”.
What does it mean “this webpage has a redirect loop”?
If you type the webpage URL that has the problem with Google Chrome, for example, you will notice an immediate message about the redirect issues as an error message. The same thing applies to Firefox, Safari and the other browsers, but with a different error message, such as, “too many redirects” and so on.
The problem is that you’ve many versions of the same URL address and they redirect the user to each other. As a result, no one of these URL will work, and the browser will work in a closed circle, and turn an error message to the visitor. The problem can be a result of broken htaccess file or a wrong code inserted there.
The second reason that can cause the problem is that you are using Google Page Speed for the website optimization, or any other service like CloudFlare or both of them. In this case, the Google cache is the problem and the problem is a URL conflict that sends the user to the Google cache, then to the server and vice versa without stopping,
That means that the Google Page Speed service cache is not updated with your latest server content, and even, if you’ve added your new IP to CloudFlare, Google cache is the problem. The fix is easy, you just need to delete the Google Page Speed cache and build the new one from the new server, follow the below steps,
Fixing the web page redirect problems
The below solutions depends on the nature of the problem and what causes the redirect errors. Just follow them one by one, or try the one that seems the appropriate for your case.
1. Reset Permalinks
The first and easiest solution that can fix the problem is to reset the WordPress permalinks. All you have to do is to login into your WordPress admin area, click on “Settings”, then, click on “Permalinks”. The final step is to just click the “save changes” button, and WordPress will automatically regenerate a new htaccess file.
That will replace the old file that can be broken. If you need a step by step tutorial, you can read how to reset permalinks in WordPress.
2. Flush caches
If you’re using Google page speed service, you have to login and flash the content including images, and all the Html and CSS files, in your account. Click on “caching and errors” as the following screenshot.
Then, type your blog URL in the “flush caches” edit box with “*” at the end as the next example.
Now, click the “flush” button and wait some seconds until the process completes, then, visit your web page after clearing your browser cache or changing the browser to verify things, even more.
3. Set up the site URL
If you have made changes to your blog URL with, or without, the “www”, you need to define your URL in the blog directory. You can do that by logging into your cPanel account, click the “file manager”, and find the “wp-config.php” file, open it and add the next code at the end.
If you can’t find how to edit the file, you can read this post about changing the blog URL.