2015年4月21日 星期二

How do I fix the infinite redirect loop error after enabling Flexible SSL with WordPress?


使用WordPress在OpenShift上,處理到使用自己的網域名的時候,一定會遇到一個問題。

那就是,OpenShift上的SSL設定,只能使用自己的次網域名(xxx-xxx,rhcloud.com)。

(謎之音:付費升級成Bronze and Silver plans就可以用Https拉)
(來源:https://help.openshift.com/hc/en-us/articles/202535440-How-do-I-get-SSL-for-my-domains-)

一旦使用自己的網域(xxx.oo),前台使用是沒有問題。

但要進到後台。就會發生網頁進入無線迴圈,導致最終管理者,無法登入進去。

PS:想知道SSL options差別,可以參考這。
What do the SSL options (Off, Flexible SSL, Full SSL, Full SSL Strict) mean?
https://support.cloudflare.com/hc/en-us/articles/200170416-What-do-the-SSL-options-Off-Flexible-SSL-Full-SSL-Full-SSL-Strict-mean-



有人寫了外掛來解決這個問題,cloudflare還有針對這點的官方文章:
https://support.cloudflare.com/hc/en-us/articles/203487280--How-do-I-fix-the-infinite-redirect-loop-error-after-enabling-Flexible-SSL-with-WordPress-?flash_digest=8269a6752f9e72fdc06367fa86c70d7bd318c348

Some users may experience redirect loops after activating CloudFlare’s free Universal Flexible SSL option with a WordPress site. In order to fix this issue and/or get things set up properly to use with WordPress, please follow the steps outlined below.

1. Install either CloudFlare Flexible SSL WordPress plugin or WordPress HTTPS plugin. Many WordPress users are using these plugins to resolve redirect loop issues in WordPress and to make the transition to https:// easier.

Note: These plugins were not created by CloudFlare.com and we do not provide support for questions related to these plugins. If you have questions or issues related to using either one of these plugins, please direct your concerns to the plugin author.

2. Install the CloudFlare WordPress plugin to make sure that the original visitor IP is being passed back at the WordPress level. Since it is likely that some of your other plugins rely on original visitor IP, installing the CloudFlare WordPress plugin will restore visitor IPs back to the WordPress level and not show CloudFlare’s IPs.

3.Go to your website over https:// to see if your website loads. Given that you didn’t have the domain set to use SSL prior to activating Universal SSL, it is likely that you will have a mixed content error warning when you look in the corner of your browser window. In order to make this error go away, you will need to go through your site and make sure assets are being loaded over HTTPS and not HTTP. Solutions can be found at:

Mozilla’s tutorial on fixing mixed content errors

WordPress Plugin: SSL Insecure Content Fixer 

4. Create a PageRule in your CloudFlare PageRule settings to force https:// with a format of *yourdomain.com* (replace yourdomain.com with your actual site). Please make sure the “Always use https://“ toggle is switched to on.


沒有留言:

張貼留言