{"id":2492,"date":"2012-04-26T15:39:22","date_gmt":"2012-04-26T22:39:22","guid":{"rendered":"https:\/\/www.wkiri.com\/today\/?p=2492"},"modified":"2012-04-26T15:39:22","modified_gmt":"2012-04-26T22:39:22","slug":"when-cloudflare-and-wordpress-dont-get-along","status":"publish","type":"post","link":"https:\/\/www.wkiri.com\/today\/?p=2492","title":{"rendered":"When CloudFlare and WordPress don&#8217;t get along"},"content":{"rendered":"<p>It&#8217;s the little things&#8230; like your website suddenly vanishing.<\/p>\n<p>My website (including this blog) is hosted by <a href=\"http:\/\/www.dreamhost.com\/\">Dreamhost<\/a>, a great company with great service.  They offer a lot of one-click installs and generally make it easy to set up a blog or email accounts or mailing lists, etc. <\/p>\n<p><a href=\"https:\/\/www.cloudflare.com\"><img decoding=\"async\" width=100 class=floatRight src=\"http:\/\/siliconangle.com\/files\/2011\/07\/cloudflare_logo-256x256.jpg\"><\/a>Recently they started offering a free <a href=\"https:\/\/www.cloudflare.com\">CloudFlare<\/a> plan to Dreamhost subscribers.  CloudFlare offers two benefits: faster webpage loads (by distributing your content across different servers around the world) and community-based protection from spam, bots, crawlers, etc.  I thought I&#8217;d try it out, so I signed up.<\/p>\n<p>When you check the &#8220;CloudFlare&#8221; box, Dreamhost warns that you need to allow them to redirect all traffic that comes in as http:\/\/mydomain.com\/ to http:\/\/www.mydomain.com\/.  This seems harmless enough, and it worked fine for me at first, until I realized that one of my <a href=\"http:\/\/wordpress.org\/\">WordPress<\/a> installations stopped working.  Trying to visit https:\/\/www.wkiri.com\/comphist\/ or https:\/\/wkiri.com\/comphist both resulted in an error: &#8220;Too many redirects.&#8221;  Oddly, my other blog (https:\/\/www.wkiri.com\/today\/) did not have this problem.<\/p>\n<p>I couldn&#8217;t find a good, concise description of how to fix this on the web, so I&#8217;m posting about it here.  Basically, the problem occurs when your WordPress installation has its location specified as http:\/\/mydomain.com\/something instead of http:\/\/www.mydomain.com\/something.  CloudFlare redirects incoming URL requests to http:\/\/www.mydomain.com\/, WordPress redirects this to http:\/\/mydomain.com\/, and so on until the server gets sick of it and tells you &#8220;Too many redirects.&#8221;<\/p>\n<blockquote><p>\nTo fix it:<\/p>\n<ol>\n<li>Turn off CloudFlare (otherwise you can&#8217;t get in to your WordPress settings).  Go to your Dreamhost panel, click &#8220;Manage Domains&#8221;, then click &#8220;Edit&#8221; for the domain in question.  Scroll down to &#8220;CloudFlare Services&#8221; and uncheck the box.  Scroll down and click &#8220;Change settings.&#8221;\n<li>Keep reloading your WordPress site until it works (i.e., the DNS updates propagate).\n<li>Log in to your WordPress site and go to the Dashboard.  Click &#8220;Settings&#8221;.  Update the &#8220;WordPress Address (URL)&#8221; and &#8220;Site Address (URL)&#8221; fields to have the form http:\/\/www.mydomain.com\/something.  Scroll down and click &#8220;Save Changes&#8221;.\n<li>You may or may not also need to clear your browser&#8217;s cookies for this site.\n<li>Go back to the Dreamhost panel, re-enable CloudFlare, and save settings.\n<li>Everything should now work! (Again, DNS updates have to propagate for CloudFlare to be activated again.)\n<\/ol>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>It&#8217;s the little things&#8230; like your website suddenly vanishing. My website (including this blog) is hosted by Dreamhost, a great company with great service. They offer a lot of one-click installs and generally make it easy to set up a blog or email accounts or mailing lists, etc. Recently they started offering a free CloudFlare [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[23,3],"tags":[],"_links":{"self":[{"href":"https:\/\/www.wkiri.com\/today\/index.php?rest_route=\/wp\/v2\/posts\/2492"}],"collection":[{"href":"https:\/\/www.wkiri.com\/today\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wkiri.com\/today\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wkiri.com\/today\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wkiri.com\/today\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2492"}],"version-history":[{"count":10,"href":"https:\/\/www.wkiri.com\/today\/index.php?rest_route=\/wp\/v2\/posts\/2492\/revisions"}],"predecessor-version":[{"id":2502,"href":"https:\/\/www.wkiri.com\/today\/index.php?rest_route=\/wp\/v2\/posts\/2492\/revisions\/2502"}],"wp:attachment":[{"href":"https:\/\/www.wkiri.com\/today\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2492"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wkiri.com\/today\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2492"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wkiri.com\/today\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2492"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}