How to Fix ERR_TOO_MANY_REDIRECTS in WordPress
文章推薦指數: 80 %
The ERR_TOO_MANY_REDIRECTS error happens when a browser can't connect to the correct server of your website. The browser goes back and forth ...
WordPress
VPS
Joomla!
Drupal
Email
Glossary
VideoTutorials
Webinars
search
Copylink
Copied!
WordPress
Errors
Nov09,2021
TomasA.
8minRead
HowtoFixERR_TOO_MANY_REDIRECTSinWordPress
Copylink
Copied!
IfyourunaWordPresswebsite,youmayencountertheERR_TOO_MANY_REDIRECTSerroratsomepoint.Thiscommonlyhappenswhenyourwebsiteisstuckinaninfiniteredirectloop,preventingyourbrowserfromreachingouttothecorrectwebserverandloadingthedesiredwebpagecontent.
ThisarticlewillshowseveralwaystosolvetheERR_TOO_MANY_REDIRECTSerror.Youwillalsolearnwhatcausesitandhowitlooksondifferentwebbrowsers.
WhatIsERR_TOO_MANY_REDIRECTS?HowDoesERR_TOO_MANY_REDIRECTSLookLikeOnDifferentBrowsersGoogleChromeMicrosoftEdgeMozillaFirefoxSafariOperaHowtoFixERR_TOO_MANY_REDIRECTS1.DeletingBrowserData2.CheckingtheURLSettings3.DeletingWordPressCache4.DisablingCorruptedPlugins5.Disablingthe.htaccessFile6.TurnOfftheContentDeliveryNetwork(CDN)Temporarily
WhatIsERR_TOO_MANY_REDIRECTS?
TheERR_TOO_MANY_REDIRECTSerrorhappenswhenabrowsercan’tconnecttothecorrectserverofyourwebsite.ThebrowsergoesbackandforththroughmultipleURLsandserverstryingtolocateyourWordPresswebsite.Asaresult,thewebsitesendsusersintoaredirectionloopthatwillnevercometoanend.
Thisredirectlooperroroccursduetoafewreasons:
MisconfiguredWordPresswebsiteaddress‒happenswhenyourwebsitepointsatthewrongdomainorhasatypointhedomainnameorthewwwprefix. Corruptedbrowsercookiesandoutdatedcache‒themostcommonculpritandtheeasiesttofix.FaultyWordPressplugin‒causedbyacorrupted,outdated,ormisconfiguredplugin.IncorrectHTTPSsettings‒occurswhenyoumisconfiguretheSSLcertificateorHTTPSredirectrules.Misconfiguredserversettings‒happenswhenthe.htaccessfilehasafaultyvariable. Issueswiththird-partyservices‒forexample,misconfiguredcontentdeliverynetwork(CDN).
Fortunately,thereareseveralmethodstofixtheERR_TOO_MANY_REDIRECTSerror.Wewillcovereachonelaterinthearticle.
HowDoesERR_TOO_MANY_REDIRECTSLookLikeOnDifferentBrowsers
EachwebbrowserhasitswayofwarninguserswhentheyvisitawebsitewiththeERR_TOO_MANY_REDIRECTSerror.Takealookatwhatseveralpopularbrowsersshowwhenyouexperiencethisproblem.
GoogleChrome
GoogleChromewillshowtheredirectlooperroras“Thispageisn’tworking.example.comredirectedyoutoomanytimes.”Thebrowserwillrecommendasolutiontosolveit,followedbytheERR_TOO_MANY_REDIRECTSerrormessageconfirmingtheproblem.
MicrosoftEdge
MicrosoftEdgewillshowthiserroras“Thispageisn’tworkingrightnow.example.comredirectedyoutoomanytimes”,followedbytheERR_TOO_MANY_REDIRECTSerrormessage.
MozillaFirefox
MozillaFirefox’serrormessagesays,“Thepageisn’tredirectingproperly.Firefoxhasdetectedthattheserverisredirectingtherequestforthisaddressinawaythatwillnevercomplete.”
Safari
Safariwillshowtheerroras“Safarican’topenthepage‒Toomanyredirectsoccurredtryingtoopen“example.com.”Thismightoccurifyouopenapagethatisredirectedtoopenanotherpagewhichisthenredirectedtoopentheoriginalpage.”
Opera
Opera’serrormessagelookssimilartoChrome’s,whichis“Thispageisn’tworking.example.comredirectedyoutoomanytimes”,followedbytheERR_TOO_MANY_REDIRECTSerrorlabel.
HowtoFixERR_TOO_MANY_REDIRECTS
ThereareafewwaystofixtheERR_TOO_MANY_REDIRECTSerror.Werecommendtryingeachofthemindividuallytofindthecauseoftheredirectloopproblem,butmakesuretotrackyourstepssothatyoucanreversethechangesifneeded.
Thatsaid,herearethesixtroubleshootingstepstofollowincaseoftheERR_TOO_MANY_REDIRECTSerrorinWordPress.
1.DeletingBrowserData
Browserdatasometimesstorescorruptedcookiesandoutdatedcache,causingtheERR_TOO_MANY_REDIRECTSerror.So,beforemakingchangestoyourWordPresssite,it’swisetocheckifit’sjustyourbrowsercausingtheerrorbydeletingitsdatahistory.
Herearethestepsyoushouldfollowtodeletethebrowser’scacheandcookies:
OnChrome,clickthethreesmalldotsonthebrowser’supper-rightmenuandselectSettings.ScrolldownandclickonAdvanced->ClearBrowsingData.ChecktheCookiesandothersitedataandCachedimagesandfilesboxes,clickCleardata.
OnMozilla,headtotheupper-rightmenubutton,selectOptions.ChoosePrivacyandSecurity,selectClearDataunderCookiesandSiteData.Makesuretocheckalltheboxes,andthenclickClear.
OnSafari,navigatetoSettings->Preferences.UnderPrivacy,selectRemoveAllWebsiteData->RemoveNow.Here,youcansetyourcookieandcachepreferencesaswell.
OnMicrosoftEdge,navigatetoSettings->Cookiesandsitepermissions.SelectManageanddeletecookiesandsitedata->Seeallcookiesandsitedata.ClickontheRemoveallbutton,andthenchooseClear.
2.CheckingtheURLSettings
Ifclearingyourbrowsingdatadoesn’tfixtheproblem,checkifyourWordPressURLsettingshavethecorrectconfiguration.
TheredirectlooperrorusuallyoccurswhenwebmastersaccidentallymaketheirWordPresssitepointatthewrongdomainwhenmigratinghostsorchangingdomainnames.
YoucandosothroughtheWordPressadmindashboardormanually.
CheckingandChangingURLSettingsManually
WhenyourwebsiteisexperiencingtheERR_TOO_MANY_REDIRECTSerror,youmightnotbeabletoaccessyourWordPressadminarea.Inthatcase,changetheURLsettingsbyeditingthewp-config.phpfilethroughyourFileManageroranFTPclientlikeFileZilla.
WewillshowyouhowtoeditthefileviaHostinger’sFileManager.
LogintothehPanelandheadtoFileManagerunderFiles.
Inthepublic_htmldirectory,findyourwp-config.phpfileandright-clicktoEdit.
Addthefollowinglinestothefile.Inthiscase,http://example.comisyourdomainname:define('WP_HOME','http://example.com');define('WP_SITEURL','http://example.com');
Aftersavingthechanges,visityourWordPresssitetocheckwhethertheURLchangefixedtheERR_TOO_MANY_REDIRECTSerror.
EditURLSettingsviaDatabase
Alternatively,youcanedittheURLsettingsviayourWordPressdatabase.ThefollowingtutorialwillshowyouhowtodoitusingphpMyAdmin.
FindyourWordPressdatabasenameviathewp-config.phpfile.LogintothehPanelandnavigatetophpMyAdminunderDatabases.SelecttheEnterphpMyAdminbuttonnexttothedatabaseconnectedtoyourWordPresssite.
AccesstheSQLtabwithinthephpMyAdminarea.
EnterthefollowingSQLquery,makingsuretoreplaceoldurl.comwiththecurrentWordPressaddressandnewurl.comwiththenewsiteaddress:UPDATEwp_optionsSEToption_value=replace(option_value,'oldurl.com','newurl.com')WHEREoption_name='home'ORoption_name='siteurl';UPDATEwp_postsSETguid=replace(guid,'oldurl.com','newurl.com');UPDATEwp_postsSETpost_content=replace(post_content,'oldurl.com','newurl.com');UPDATEwp_postmetaSETmeta_value=replace(meta_value,'oldurl.com','newurl.com');
ClickGotoexecutethequery.Openthewp-optionstableandchecktheoption_valueofsiteurlandhometoseewhethertheupdateprocesswassuccessful.
Ifyouneedmoreinformation,makesuretocheckourtutorialabouthowtochangeWordPressURLsinMySQLdatabaseusingphpMyAdmin.
Ifyourwebsitefileisinthedefaultrootfolder(/public_html/),youcanusethedefault(http://example.com/)URL.Ifit’sinasubfolderlike(/wp/),thenreplacetheURLwithsomethinglike(http://example.com/wp).
ChangingURLSettingsviaAdministratorDashboard
AnothersolutiontochangetheURLsettingsisthroughyourWordPressdashboard.Followthestepsbelowifyoucanlogintotheadmindashboard.
NavigatetoSettingsfromyourWordPressadmindashboard.OntheGeneralSettingspage,checkyourWordPressAddress(URL)andSiteAddress(URL).
MakesurebothURLsareconfiguredcorrectly.Ifyoueditthem,don’tforgettosaveanychangesmade.
3.DeletingWordPressCache
Yourbrowserisn’ttheonlyplacepronetostoringcorruptedcache.Insomecases,cachestoredonyourWordPresssitemaycausetheERR_TOO_MANY_REDIRECTSerror.Toclearyourcache,pickoneofthesetwooptions.
1.UsingtheWPFastestCachePlugin
WPFastestCacheisafreemiumWordPresscacheplugin.Thecachingfeatureincludedinthefreeversionismorethanenoughtohelpyoudeletethecachestoredonthewebsite.
Here’showtoclearthewebsitecacheusingtheWPFastestCacheplugin:
LogintoyourWordPressdashboard.HeadtoPlugins->AddNew.FindWPFastestCacheusingthesearchbarandclickInstallNow->Activatetosetuptheplugin.RefertoourguideformoreinformationonhowtoinstallWordPressplugins.LookfortheWPFastestCacheoptionunderSettings.OntheDeleteCachetab,choosewhichoptionbestsuitsyourneeds.
Iftheprocessissuccessful,aconfirmationmessagewillappearatthetopofthepage.
2.UsingtheWPRocketPlugin
WPRocketisapremiumWordPresscacheplugin.Besidesbeingcompatiblewithpopularthemes,plugins,andhostingproviders,WPRocketalsocomeswithfeaturesthatadherebestpracticesinwebperformance.Itspricesrangefrom$49/yearto$249/year.
ToclearthewebsitecacheusingtheWPRocketplugin,followthesesteps:
Afterpurchasingtheplugin’slicense,downloadittoyourcomputer.UploadthepluginfiletoWordPressandinstallitmanually.AccesstheWPRocketdashboard.SelectClearCacheunderQuickActionstoremoveallcachedfiles.
4.DisablingCorruptedPlugins
AnotherproblemthatmightcausetheERR_TOO_MANY_REDIRECTSerrormessageisacorruptedoroutdatedplugin.Insomecases,certainWordPresspluginsthatimplementredirectsmightconflictwithyourserver’sredirects.
Tocheckwhetherthat’sthesourceoftheproblem,disableallofyourpluginsbymanuallyeditingthefolder.
Youcandosothroughyourhostingprovider’sFileManageroranFTPclient.Here,we’llbeusingthelatter.
First,configureyourFileZillaclient.Ifyouneedmoreinformationonhowtodoit,weprovideacomprehensiveguidetohelpyouuseFileZilla.Onceyou’reloggedin,selectRemoteSite.Gotowp_contentandlocatethePluginsfolder.
Right-clickthefolderandrenameittoplugins_disabled.Trytoaccessyourwebsite.Iftheerrormessagenolongerappears,thenoneormorepluginsarecorruptedoroutdated.RenamethefolderbacktoPluginsandfollowthesametroubleshootingprocesswitheachplugin’sfoldertocheckwhichoneiscausingtheerror.Werecommendstartingwiththeonemostrecentlyinstalled.
5.Disablingthe.htaccessFile
There’sapossibilitythatafaultyvariableorconflictingredirectrulesinyour.htaccessfileismakingyourwebsitegointoaredirectloop.Ifthat’stheissue,disablingthefileletsyouregainaccesstothesite.
Wewillwalkyouthroughtheprocessofdisablingthe.htaccessfileviaHostinger’sFileManager.
AccesstheFileManagerviaHostinger’shPanel.Locateyour.htaccessfile.Right-clicktoRenamethefile.Youcanuse.htaccess_disabled,forexample.
Nowcheckifthewebsiteisloadingcorrectly.
Ifitworks,checkthe.htaccessfile’sconfigurationbyright-clickingonitandselectingEdit.Itshouldlooklikethedefault.htaccessconfiguration.Otherwise,deletethecontentfromthefileandpastethesedefaultrulesinstead:
#BEGINWordPress
延伸文章資訊
- 1How to Fix ERR_TOO_MANY_REDIRECTS in WordPress
The ERR_TOO_MANY_REDIRECTS error happens when a browser can't connect to the correct server of yo...
- 2"Too many redirects" ONLY when trying to access wp-admin ...
I found a solution that fixed my issue. Sources: A.) https://sharpten.com/blog/2018/01/17/wordpre...
- 3Quick And Easy Fix For ERR_TOO_MANY_REDIRECTS ...
Usually, this error indicates an incorrect configuration in your WordPress settings file, and, as...
- 4How to fix ERR_TOO_MANY_REDIRECTS in WordPress
What is ERR_TOO_MANY_REDIRECTS or redirection loop ... Said error appears because the browser can...
- 5Easy Fixes for “ERR_TOO_MANY_REDIRECTS” Error on ...
How to Fix “ERR_TOO_MANY_REDIRECTS” Error · Clear Your Browser's Cookies · WordPress URL Settings...