How to fix ERR_TOO_MANY_REDIRECTS in WordPress

文章推薦指數: 80 %
投票人數:10人

What is ERR_TOO_MANY_REDIRECTS or redirection loop ... Said error appears because the browser cannot access the specified web address and ends up returning an ... Creatingawebpagemayseemquitesimple,butithascertainaspectsthatcanpresentcomplications.ArelativelysimpleoptionistocreateawebpagebasedonWordPress,andifwedonotknowhowtohandleitwell,itcangeneratedifferenterrors.AmongthemostcommonproblemsisERR_TOO_MANY_REDIRECTS.InthispostwewillindicatethepossibleoriginandhowfixERR_TOO_MANY_REDIRECTSGoogleChrome,forexample,willtellusthat“thiswebpagehasaredirectloop.Firefoxinsteadwilltellusthat"thepageisnotredirectingcorrectly".WehavemadeamistakeinWordPressthatgeneratesaredirectloop.Relax,wearegoingtoexplainhowtosolvethisproblem.TableofContentsWhatisERR_TOO_MANY_REDIRECTSorredirectionloopHowtofixERR_TOO_MANY_REDIRECTSThecookiesThecacheWordPressSettingsProblemin"wp-config.php"Pluginscouldbetheproblem.HtaccessfileConclusionWhatisERR_TOO_MANY_REDIRECTSorredirectionloopSaiderrorappearsbecausethebrowsercannotaccessthespecifiedwebaddressandendsupreturninganerror.Usuallyeverythingiscausedbya310error,whichcanendupgeneratinga404error.OurwebsitehasanaddressorURLsothatbrowserscanaccessit.Ifweorausertriestoaccessandwehavenotconfigureditcorrectly,itcouldendupgeneratingaloop.Whenwetellthebrowsertoaccess,thebrowserisactuallyreadinganotherURLandgoingtothatone,andshowingittoyou.Ifthisrepeats,itisaloopthatwehavetocorrect.Thisisaproblemandcouldaffectasfollows:QuickpenaltybysearchenginesUserswillleaveandnotreturn,astheseerrorsareoftenassociatedwithsecurityproblemsLossofusertrustand,therefore,lossoftrafficHowtofixERR_TOO_MANY_REDIRECTSLet'sseepossibleculpritsforthisproblemThecookiesPossiblytheproblemisours,ourcookiesorthoseofourvisitorsbecauseofus.Thefirstthingweshoulddoischeckthecookiesinourbrowser,comeon,deletethem.Here'showtodeletethem:FirefoxChromeEdgeSafariOperaAnotherpossibilityisthatthecookiesonourwebsitedonotworkcorrectly.Tosolvethis,wecanaddthefollowinglinesofcodetothewp-config.phpfile:define('ADMIN_COOKIE_PATH','/');define('COOKIE_DOMAIN','');define('COOKIEPATH','');define('SITECOOKIEPATH','');Thesefourlinesofcodeautomaticallydeletecookies.Thiswaywesaveourselvesfrommanuallydeletingcookieseverytimeweentertheweb(andtheuseraswell)READMOREOpensourcesoftwaretakesmuchlongertofixvulnerabilitiesThecacheOurgreatfriend,thecache,couldalsobeourgreatestenemy.Althoughwehavefixedit,itcouldbethecasethatthecacheofourbrowserorthatoftheserverisgeneratingredirectsintheURL.Youcanseeifitisabrowserproblembypurgingthecache.Heretheexplanation:ChromeFirefoxEdgeSafariOperaIncasetheproblemisWordPress,wemustfollowthesesteps:EmptythecacheofourpluginDisablecachepluginIfitisourserver:Wemustclearthecacherulesin.htacces.BEFOREMAKEACOPYOFTHE.HTACCESSFILEIncaseourhostinghasitsowncachesystembydefault,wemustfirstemptyitfromthehostingpanelandthendeactivatethecacheWordPressSettingsPerhapstheERR_TOO_MANY_REDIRECTSiscausedbyasmallerrorwhenconfiguringthegeneralsettings.Wemustgoto"Settings>General"andverifythatwehavethesameURLin"WordPressAddress"and"SiteAddress".Themostcommonmistakeisthatoneiswith"www"andtheotherwithout"www."Itcouldalsobethatonehas"https"andtheother"http."BothURLsshouldbethesame,unlessyouhaveyourowninstallation.Ifthisisnotthecase,checkthatthetwoURLsarethesame,andiftheyarenot,putthemthesame.Savethechangesandnowverifythateverythingworkscorrectly.Problemin"wp-config.php"ThereisapossibilitythatyoucannotaccesstheWordPressadministratorpanel,butdon'tworry.WhatyouhavetodoisgotothemanagementpanelofyourhostingorbyFTPlookforthefile"wp-config.php".Wearegoingtoedititandaddthefollowinglinesofcode.define('WP_HOME','https://mydomain.com');define('WP_SITEURL','https://mydomain.com');Whereitsays"https://mydomain.com"youmustputtheURLofyourwebsite,oursisjustanexample.PluginscouldbetheproblemItisnotthemostcommon,butitcouldbethattwopluginsarefreakingoutandaretoblameforERR_TOO_MANY_REDIRECTS.Anyofthepluginsthatwehaveinstalledcouldhaveaprogrammingerrororgenerateincompatibilitywithanother.Nothinghappens,let'sfixit.READMOREHowtomakeacoverinWordandcustomizeit-StepbystepWordPressmakesuseofthefunction"wp_redirect()”Fordifferentcases.Somepluginsalsousethisfunction.Misuseofthisfeatureorwrongcombinationcouldleadtoredirectproblems.Thefirstthingwewilldoisdeactivateallthepluginsandseeifthatwaywehavemanagedtocorrecttheproblem.Ifthedeactivationofallofthemcorrectstheproblem,wealreadyknowthatthereisonethatisfighting.NowwewillactivatethepluginsonebyoneandverifythattheERR_TOO_MANY_REDIRECTSdoesnotappearagain.Youcancheckiftheconfigurationisnotcompletelycorrectandistheculpritoftheredirect.Ifyoudon'tseeanything,calmdown,deactivateit,deleteitandlookforonethatdoesn'tcauseproblems.Donotgiveitmorelaps..HtaccessfileWenowcometooneoftheperhapsmostcomplexpoints.The.htaccesfileisbeinggeneratedbytheApacheserverandimportantparametersareset.Thisfileestablishestherulesforwritingtitles,serverbehavior,optimizationsandredirects.Perhapsyouhavemodifieditoroneofthepluginsthatwehaveinstalled.ItispossiblethatsomeoftherulesisnotwellwrittenandistheonethatisgeneratingtheERR_TOO_MANY_REDIRECTS.Reviewinglinebylinemaynotbeeasy,butithastobedone.Althoughwecanchoosetogolittletothebeast,followingthesesteps:Createabackupcopyofthe.htaccesfile,comeon,downloadacopytoyourcomputerforwhatmighthappenDeletethe.htaccessfileandverifythatyourwebsitecannowbeaccessedWegototheWordPressbackendandin"Settings>PermanentLinks"savethechangeswithouttouchinganythingelse.WordPressthusgeneratesanewcleananderror-free.htaccesfile,andthewebshouldnowwork.CheckthateverythingisworkingcorrectlyandtheERR_TOO_MANY_REDIRECTSmessagenolongerappears.ConclusionTheseareallthepossibleoriginsoftheERR_TOO_MANY_REDIRECTS.Oneofthesestepsshouldfixtheredirectproblemforgood.Ifbydoingallthisyouhavenotmanagedtocorrectit,youmayhavemissedsomething.Don'ttrytofixitinfiveminutes,sitbackandtakeyourtimetocorrecttheproblem.Slowlybutsurely.RobertoSoléFollowonTwitterSendanemail6July202001.2024readingminutesShowmoreFacebookTwitterLinkedInTumblrPinterestRedditVKontakteWhatsAppTelegramShareviaemailPrintRobertoSoléDirectorofContentsandWritingofthissamewebsite,technicianinrenewableenergygenerationsystemsandlowvoltageelectricaltechnician.IworkinfrontofaPC,inmyfreetimeIaminfrontofaPCandwhenIleavethehouseIamgluedtothescreenofmysmartphone.EverymorningwhenIwakeupIwalkacrosstheStargatetomakesomecoffeeandstartwatchingYouTubevideos.Ioncesawadragon...orwasitaDragonite?WebsiteTwitterLinkedInRelatedpublicationsHowtogettheRubiusinWatchDogsLegion31october,2020WhatisMovidy11January2021WhatisRAM30July2020FivegreatYouTubechannelstolearncuriosities,technologyandlearntosaveandmakemoney21April2018SEECOMMENTSFacebookTwitterLinkedInRedditWhatsAppTelegramButtonbacktotopCloseRSSFacebookTwitterYouTubeInstagramPayPalCategoriesAnalysis(384)Storage(30)Speakers(5)Android(4)PowerSupplies(13)Hardware(3)Annualreports(4)Monitors(3)Peripherals(178)Baseplates(18)LaptopsandPCs(15)Processors(12)Refrigeration(34)GraphicsCards(17)Keyboards/Mice(30)VideoGames(15)Articles(449)Cryptocurrencies(24)Events(10)Gaming(43)GuidesandTutorials(123)Components(5)Connectivity(18)Peripherals(5)Hardware(37)Opinion(28)Software(14)VideoGameTokens(17)GoogleStadia(59)NintendoSwitch(188)NintendoWiiU(13)News(12.230)Science(161)Consoles(215)Cryptocurrencies(1.121)Entertainment(41)Hardware(5.378)Internet(793)PressReleases(440)Opinion(10)Others(186)Peripherals(413)Notebooks(153)SmartPhones(649)Software(596)VideoGames(1.711)PC(421)Pc(1)PlayStation(6)PlayStation2(13)PlayStation3(21)PlayStation4(305)PlayStation5(28)Budget(8)Smartphone(70)Giveaways(14)Uncategorized(3)XboX(12)Xbox360(23)XboxOne(292)XboxSCarlett(15)Posting....CloseAccessHaveyouforgottenthepassword?RemembermeAccessDon'thaveanaccount?GotomobileversionWeusecookiestoensurethatweprovideyouwiththebestuserexperienceinourwebsite.Ifyoucontinueusingthissitewewillassumethatyouagree.OK



請為這篇文章評分?