Skip to Main Content

How to Fix Redirect errors on WordPress

Divi: the easiest WordPress theme to use

Divi: The best WordPress theme of all time!

With over 701.000 downloads, Divi is the most popular WordPress theme in the world. It is complete, easy to use and comes with more than 62 free templates. [Recommended]

Your site website does not appear and your browser tells you that there are too many redirects. Such a mistake probably makes you scratch your head, but you can stop frowning, because there is an easy solution.

This type of error is known as a 301 error, but can sometimes appear as 404 error "page not found" page (in French).  

It's not all that dramatic, but the problem is that your browser can't access your website because the address you entered doesn't point to the right place. 

But before, if you have never installed WordPress discover How to Install a WordPress Blog in 7 Steps et How to search, install and activate a WordPress theme on your blog 

Then back to why we are here.

redirection loop windows

To resolve the issue, all you need to do is adjust your website URL settings, but depending on the circumstances, the fix may require a little more effort.

Don't worry, because in this tutorial we are going to see the real meaning of this error, how it manifests itself and how to fix it by changing a few settings or with a little code.

Reason for this error

Most of the time, these error messages occur when there is a configuration error in your settings, but sometimes it can be more complicated than that.

You may see these error messages if:

  • Your website's home page and URLs are different or incorrect
  • There are installed WordPress plugins that are misconfigured and operate in redirection
  • There is an error with the custom modifications on the file .htaccess
  • A new website is created in your network with the same URL as a deleted website

These errors may all seem trivial, but any one of them can break your website and cause a redirect error. Solving these probable causes is the next step in getting your blog up and running.

How to get out of the loop

A closer look at each of the possible causes ofredirection error can help you identify an error that your website is encountering. After you apply the patch, your website should start to appear again. You can try other solutions.

The website home page and URLs

The home page URL is the address you want your visitors to enter in their browsers to access your website. You will find this configuration below the name of your blog in the page Settings> General for single WordPress installations, and represents the website address.

The website URL is where your website and its files can be found. It is also called theaddress of WordPress (URL)  on the general settings page for individual installations.

If these two URLs are not correctly defined or there is a typo, then this could lead to a redirection error. In principle, the value of both is the same, but this is not always the case. They should also DO NOT include a bar at the end and must be consistent in their structure.

Both URLs must also have " http:// » forward, unless you have a SSL certificate installed, in which case you will have to use " https://" page (in French).

If any of the addresses include a www. At first, the other should also have this. You shouldn't end up with a WordPress URL and website URL similar to this:

Showing WordPress Regalge Links

Easily create your website with Elementor

Elementor allows you to easily create any website design with a professional look. Stop paying expensive for what you can do yourself. [Free]

If you can not access the general settings page or if you have a multisite network, you can always edit these URLs to make sure they are correct. Add the code below to your file wp-config.php :

define ('WP_HOME', 'http: //yoursite.com'); define ('WP_SITEURL', 'http: // votresite .com');

These two lines must also be placed above the comment /* That's all, stop editing! Happy blogging */.

Keep in mind that you need to replace http://votresite.com with your real url. Also, if you have only one installation, you will not be able to modify these addresses in the settings of the dashboard after adding these two lines.

Redirects made by a plugin

WordPress uses the function wp_redirect () to be used by permalinks, some plugins and WordPress themes. This function allows you to redirect to another page of your website. It can also be used to make 301 redirects.

Once a redirect is in place, it changes the location where an address points to another destination.

A 301 redirect can be useful if you want visitors to an old article you wrote to be automatically redirected to a new, updated article on the same topic, for example, but there are other reasons why a redirect might be helpful. 

For example, if you have a new domain name and want to send your users to your new domain.

Continue consulting How to make a redirection on your WordPress blog

If you have tried to point an article, page, or subweb in your network to one that already exists, by visiting the page you will get a redirect error. The unique URL will be attached to two pages and the browser will not know which page is the correct one.

If WordPress does not let you create duplicate links when you're writing an article, it's possible to accidentally create duplicate links if you use a plugin that creates 301 redirects for you.

To resolve this issue, disable any plugins you have installed that use the wp_redirect () function. If you are not sure which plugin is causing the redirect, you can deactivate all plugins, by changing the plugins folder in "wp-content" via your FTP server.

Check that your site is displayed normally. If the site is displayed, you can gradually activate the plugins to detect the cause of the plugin.

Discover also the 6 regular questions related to SEO and redirects

Restore the .htaccess file

Do you remember when you made custom changes to your file .htaccess ? If it's recent, then that's probably the root of the problem. Check the file to verify that there are no duplicate redirects or URLs that are not correct.

If you can not find anything, you can download a copy of your .htaccess file as a backup and download a new copy without all your customizations. You can discover the content that your new file should have by visiting the .htaccess page on the WordPress Codex.

Download the new copy to your website and try to visit the main page. If your website is showing, then the .htaccess file was responsible. Try adding them again, one by one, until you find the error.

Are you looking for the best WordPress themes and plugins?

Download the best plugins and WordPress themes on Envato and easily create your website. Already more than 49.720.000 downloads. [EXCLUSIVE]

Go further in handling this file by consulting the 5 htaccess tricks to improve the security of your WordPress blog

Clear your browser cache and cookies

Sometimes it is enough to clear your browser's cache and cookies. If you make a major change to your website, it may not be accessible until you completely clear your cache or cookies.

Since a static copy of your website is temporarily saved in your browser to load faster, this means that new changes cannot be taken into account if you do not delete, the changes will not be taken into account. .

Discover How to clean the cache of your WordPress blog

If you get into the habit of backing up your website often. The easiest solution would be to restore the version of your blog files.

Discover also some premium WordPress plugins  

You can use other WordPress plugins to give a modern look and optimize the grip of your blog or website.

We offer you here some premium WordPress plugins that will help you do that.

1. Super Backup & Clone - Migrate

The WordPress Super Backup & Clone - Migrate plugin will allow you to back up your website. Indeed, working on your website is always a long and cumbersome process, and it would be a shame if you lost your work due to a bad configuration or a handling error.

Super backup clone migrate for wordpress

Its main features are: an intuitive dashboard, the ability to keep several instances of backups, the migration to another possible server, Restoring backups, automatic diagnostics, excellent customer support, multisite support, etc.

This WordPress plugin is a reliable backup solution that will help you avoid losing your data. 

Download | Demo | Web hosting

2. Backup And Restore

Backup And Restore is a WordPress plugin that will help you plan backups of your website to a local server or to different cloud servers such as Dropbox, Google Drive, and Amazon S3. You will have the option to restore your entire website, including the database from existing restore points, with just one click.

Backup and restore

Its main features include: full backup of the website, backup on Amazon S3, Google Drive, Dropbox, disk space manager, auto deletion of old backups, complete restoration of your website, support for multisiteEtc. ..

Uploading your website, database and all your backups will also be possible. This WordPress plugin will help you manage backup and restore processes in an easy, secure and reliable way..

DownloadDemo | Web hosting

3. Backup

Backup is a WordPress backup and migration plugin for your website. It offers the easiest and fastest tools to backup, restore or migrate websites.

Backup

Its features are: unlimited backup, unlimited restore, website migration from one hosting / domain to another, downloading backups to local pc, scheduling backups, downloading and exporting from Dropbox, Google Drive and Amazon S3, etc.

Easily create your Online Store

Download free WooCommerce, the best e-commerce plugins to sell your physical and digital products on WordPress. [Recommended]

DownloadDemo | Web hosting

Recommended Resources

Discover other recommended resources that will help you resolve other errors commonly encountered in WordPress. 

Conclusion

Here is ! That's it for this tutorial dedicated to correcting redirect errors on WordPress. Do not hesitate to share it with your friends on your Social networks preferred. 

However, you will also be able to consult our resources, if you need more elements to carry out your projects of creation of Internet sites, by consulting our guide on the WordPress blog creation.

But, in the meantime, tell us about your Comments and suggestions in the dedicated section.

...

This article features 10 comments

  1. Hello,
    Thanks for the article.

    I am adding my modest contribution to the list of the 4 above-mentioned causes that create a redirect loop for a WordPress site.
    My Apache configuration file (in / etc / apache2 / sites-available /) actually contained the following directive that is incompatible with WordPress .htaccess redirects:
    RedirectMatch ^ / index.php

    Mederic.

  2. I have a blog under wordpress but hosted at hostgator. In settings, I accidentally modified the url and since then I can no longer access my site in administrator mode.

  3. Hello, I have moved my wordpress site from one subdirectory to another subdirectory and I have access to the dashboard but cannot display the site. Google tells me that there are too many redirects. I cleared all my cookies and never touched the htaccess file. The site addresses seem correct. If I deactivate the plugins, will I have to reconfigure them all? Otherwise what should I do?
    Merci de votre réponse

Leave a comment

Your email address will not be published. Required fields are marked with *

This site uses Akismet to reduce unwanted. Learn more about how your comments data is used.

Back To Top
11 shares
Share10
tweet1
Save