"Too many redirects" ONLY when trying to access wp-admin ...

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

I found a solution that fixed my issue. Sources: A.) https://sharpten.com/blog/2018/01/17/wordpress-stuck-many-redirects-error-loop-using-ssl.html. WordPressDevelopmentStackExchangeisaquestionandanswersiteforWordPressdevelopersandadministrators.Itonlytakesaminutetosignup. Signuptojointhiscommunity Anybodycanaskaquestion Anybodycananswer Thebestanswersarevotedupandrisetothetop Home Public Questions Tags Users Unanswered FindaJob Jobs Companies Teams StackOverflowforTeams –Collaborateandshareknowledgewithaprivategroup. CreateafreeTeam WhatisTeams? Teams CreatefreeTeam Teams Q&Aforwork Connectandshareknowledgewithinasinglelocationthatisstructuredandeasytosearch. Learnmore "Toomanyredirects"ONLYwhentryingtoaccesswp-adminpage AskQuestion Asked 3years,6monthsago Active 2yearsago Viewed 56ktimes 20 6 IfiguredIwouldaskmyownquestionseeingastheduplicatequestion(s)stillhaven'tbeenanswered. ForsomereasonaftermyfreshinstallofWordpress4.9.1onmyUbuntuVPS,enablingmy"flexible"SSLissuedbyCloudflare,andfinallyswitchingmyURLsinWordpress(from"https://foo.com"to"https://foo.com")Icannolongeraccessmyadminpanel. AttemptedFix#1:Clearingbrowser(s)cookies,cache,andsaveddata,aswellasanyCloudflarecaches. AttemptedFix#2: Modifyingwp-config.phpwiththecode: define('WP_HOME','https://foo.com'); define('WP_SITEURL','https://foo.com'); AttemptedFix#3:Disabling.htaccessfilein/var/www/html/ NoneoftheabovehasworkedandunfortunatelyIstillcannotaccesstheadminpanel.However,thedefaultwordpresshomepageloadsjustfineatthecorrectsecure,"https"URL. wp-adminredirecthtaccess Share Improvethisquestion Follow askedMay8'18at4:28 MattMatt 70111goldbadge55silverbadges66bronzebadges Addacomment  |  6Answers 6 Active Oldest Votes 40 Ifoundasolutionthatfixedmyissue. Sources: A.)https://sharpten.com/blog/2018/01/17/wordpress-stuck-many-redirects-error-loop-using-ssl.html B.)(SublinkwithinA)https://wordpress.org/support/article/administration-over-ssl/ Excerpt: Addingthefollowinglinesofcodeattheendofmywp-config.phpfileresolvedtheredirectconflict. if(strpos($_SERVER['HTTP_X_FORWARDED_PROTO'],'https')!==false) $_SERVER['HTTPS']='on'; Share Improvethisanswer Follow editedOct24'19at12:11 Sam 10344bronzebadges answeredMay8'18at4:45 MattMatt 70111goldbadge55silverbadges66bronzebadges 9 There'sapluginforthat – kero May8'18at5:44 5 Incasesomeoneelsestumblesontothis-thosetwolinesworkedforme,butonlyifIplacedthematthetopofwp-config.php. – MariusBughiu Nov24'18at12:33 Thisanswerdidnotworkforme. – PhilippeDelteil Mar13'19at21:17 Ifabovedid'thelp,youmaytrytoaddfollowinglineabove:define('FORCE_SSL_ADMIN',true);and/or:"SetEnvIfX-Forwarded-ProtohttpsHTTPSonthetop"(withoutquotes,onthetopofthefilebeforeanythingelse)toyour.htaccess – S1awek Apr13'19at10:19 3 Ifyouusecloudflare,setSSL/TLSencryptionmodetoFull.That'sit!Itwillloadlikeacharm. – JakirHossain Dec23'19at13:48  |  Show4morecomments 10 IusedtheaboveanswerbyMattandaddedoneelsecaseaswell: if(strpos($_SERVER['HTTP_X_FORWARDED_PROTO'],'https')!==false) $_SERVER['HTTPS']='on'; else $_SERVER['HTTPS']='off'; Itworked.Ihadalsoplaceditatthebeginningofthewp-config.php Share Improvethisanswer Follow answeredAug16'19at10:32 PrateekTambiPrateekTambi 10111silverbadge22bronzebadges 2 worked.AlsoitneedstobeaddedtoTOPaftersettings"links? 2 Can'taccessadmindashboardwithwp-adminwithout/index.phpafterit Related 0 TooManyRedirects-WP-AdminOnly 2 Stuckinredirectloopafterusingwp_loginaction 0 Resolvingthetoomanyredirectsonwordpress 1 https-toomanyredirects 2 Wordpressmultisitesubdirectoryonnginxbehindreverseproxy 1 LandingPageRedirectChain|http->https->httpswww 0 Can'taccesswp-admin,redirectstohttp://%24domain/wp-admin/ HotNetworkQuestions Meanofbooleanlist CanVoyager1reachAndromedaGalaxy? HowcouldabeautifulyoungvirginkeepDavidwarmphysically? Howdoyoustudyatextbookthatdoesn'thaveanyexercises? Findthemaximumnumberofnonprimes Countrynamesfromothercountrynames Ihavebeeninvitedtojoinadiversityteam,whataretheadvantagesanddisadvantages? CMDrunscommand,butin.batitisnotworking Didmyinstallergivemethewrongoverheaddoorspringsorismymotorjusttooweak? Convertnumber1-5fromitsspelt-outform Evolutionarypressuresforcarnivorouselves InFPGAs,isitsafetoexecutenon-blockingassignmentslike`b<=a;a<=0;`inthesameclockcycle? Sizeofsetofintegerswithallsumsoftwodistinctelementsgivingsquares ConstructingSolarPanelsfromSquares Isthereany"CosmologicalPrinciple"? FloatingPointindexOf HowtoovercomethesetbacksofanegligentsupervisorafterearningaPhDdegree? underwatercalendarformerfolk? Whathappenstomycandy-creatureswhentheygetwetandhowdoIstopit? Howtomakethinsilkmaterialwhichcanbeseenthrough?(Itriedbothquestionsonstackexchangerelateto'silk') Arethereanygapsintherangeofgravitationalwavefrequencieswecandetect? HowcanImakeashellaliasworkimmediately? HowdoesGazeofTwoMindsinteractwithBlindsightandothernon-vision/hearingsenses? WhatistheinputandoutputcurrentoftheGPIOpinsofamicrocontroller? morehotquestions Questionfeed SubscribetoRSS Questionfeed TosubscribetothisRSSfeed,copyandpastethisURLintoyourRSSreader. default Yourprivacy Byclicking“Acceptallcookies”,youagreeStackExchangecanstorecookiesonyourdeviceanddiscloseinformationinaccordancewithourCookiePolicy. Acceptallcookies Customizesettings  



請為這篇文章評分?