Cloudflare Help Center
Articles in this section
Connect with the Cloudflare Community
More on this topic: Discussions and Tips
Connect with the Cloudflare Community
Troubleshooting redirect loop errors
Resolve redirect loop (too many redirects) errors that prevent visitors from viewing your website.
Overview
The two typical causes of redirect loop errors are:
Browsers typically display error messages when redirect loop errors occur, such as:
Cloudflare SSL options incompatible with your origin web server
The most common cause of redirect loops is due to a combination of
Cause
The Flexible SSL encryption mode in the Cloudflare SSL/TLS app Overview tab encrypts traffic between the browser and the Cloudflare network over HTTPS. However, when the Flexible SSL option is enabled, Cloudflare sends requests to your origin web server unencrypted over HTTP. Redirect loops occur if your origin web server is configured to redirect all HTTP requests to HTTPS when using the Flexible SSL option.
Redirect loops may also occur when using the Full or Full(strict) SSL option. The only difference is that Cloudflare contacts your origin web server over HTTPS and the redirect loop occurs if your origin web server redirects HTTPS requests to HTTP.
Resolution
Resolve redirect loops via one of the following methods:
Page Rule misconfiguration
Cause
Redirect loops also occur if two conflicting Page Rules are configured with Forwarding URL settings. For example, one Page Rule redirects traffic for a.example.com to b.example.com and another page rule redirects traffic for b.example.com to a.example.com.
Resolution
Check the rules in Rules > Page Rules to confirm if you have two rules configured to forward traffic to each other.
Cloudflare редирект с https на http
Попробуйте один из вариантов
Не думаю что в htaccess можно добиться такого результата, это больше DNS настройка, если допустим Вы работаете через CloudFlare, то во вкладке «Page Rules» нужно добавить новое правило для переадресации на httpS или наоборот.
CloudFlare переадресации делает также с помощью заголовков, которые отдаются веб сервером при проксировании запросов к Вашим сайтам.
Евгений Русаченко, спасибо, что откликнулись. К сожалению, ни один из вариантов не работает.
Задай вопрос в тех поддержку своего хостинга, 100% они решат проблему. Особенности редиректор возникают от особенностей начинки серверов.
Очень странно. Можете предоставить ссылку на файл с phpinfo (можно в ЛС)? Посмотрю заголовки.
Вот уж что то, а начинка сервера вообще к этому отношения не имеет.
Stek:
Вот уж что то, а начинка сервера вообще к этому отношения не имеет.
Все верно, сначала получение сертификата (в данном случае еще и предупреждение) и только потом редирект.
Cloudflare Help Center
Articles in this section
Connect with the Cloudflare Community
More on this topic: Discussions and Tips
Connect with the Cloudflare Community
Configuring URL forwarding or redirects with Cloudflare Page Rules
Learn how to set up URL forwarding or redirects with Cloudflare.
Overview
You can define a page rule to forward or redirect traffic to a different URL using the Rules app in the Cloudflare dashboard.
Forwarding examples
Imagine you want site visitors to easily reach your website for a variety of URL patterns. For instance, the Page Rule URL patterns *www.example.com/products and *example.com/products match:
but do not match: Once you have created the pattern that matches what you want, click the Forwarding toggle. That exposes a field where you can enter the address I want requests forwarded to. If I enter the address above in the forwarding box and click Add Rule, within a few seconds any requests that match the pattern I entered will automatically be forwarded with a 302 Redirect to the new URL.
Advanced forwarding options
If you use a basic redirect, such as forwarding the root domain to www.example.com, then you lose anything else in the URL.
To fix the forwarding from the root to www in the above example, you could use the same pattern: You’d then set up the following URL for traffic to forward to: In this case, if someone went to: They’d be redirected to:
21 способ перенаправления c http на https (redirect)
Очень много вопросов ходит вокруг данной темы. Как сделать свой сайт безопасным? Наша веб-студия mad design собрала все возможные варианты, какими пользуемся мы:
Первое, что необходимо сделать, это получить SSL-сертификат. Вы можете приобрести его или получить бесплатно у большинства компаний, которые предоставляют услуги хостинга.
Что такое SSL-сертификат и зачем он нужен:
И так, сертификат куплен. Теперь нам необходимо, что бы наш ресурс с http://вашдомен.ru переходил автоматически на https://вашдомен.ru. Для этого необходимо все настройки и манипуляции произвести в файле «.htaccess», который располагается в корневой папке вашего сайта.
Вот все самые простые и популярные варианты настройки редиректа для разных сценариев:
В предложенном варианте:
При использовании 301 редиректа рейтинг сайта в поисковых системах сохраняется.
Аналогичный синтаксис простого редиректа в другом примере:
В примере ниже выполняется редирект с www.old-domain.ru на www.new-domain.ru:
RewriteCond задает условие, при котором происходит выполнение правила, указанного в RewriteRule. Таким образом, при запросе любой страницы www.old-domain.ru или old-domain.ru будет осуществлен переход на адрес www.new-domain.ru.
Данное перенаправление также может быть выполнено двумя способами. В примерах осуществляется редирект с forum.example.ru на www.forum.example.ru.
Способ 2 (в данном способе нет необходимости указания домена).
Cloudflare Help Center
Articles in this section
Connect with the Cloudflare Community
More on this topic: Discussions and Tips
Connect with the Cloudflare Community
Understanding Cloudflare Mobile Redirect
Learn how Mobile Redirect optimizes the look and feel of your website for use on mobile devices.
Overview
Mobile Redirect allows you to automatically redirect mobile device visitors to a mobile-optimized website or subdomain home page. The redirect is done at the edge of Cloudflare’s network, improving the user experience by eliminating a roundtrip to your server.
You must have Cloudflare’s performance service enabled («orange clouded» in the DNS Settings) for the redirect to be active.
Enable Mobile Redirect
1. Log into your Cloudflare account.
2. Click the appropriate Cloudflare account for the domain where you want to enable Mobile Redirect.
3. Click the Speed app.
4. Click the Optimization tab.
5. Scroll down to the Mobile section of the Optimization tab.
6. Select the subdomain that you would like to redirect from the drop down list.
7. Choose Keep Path or Drop Path.
Compatible mobile devices
Browsers from the following mobile devices are redirected to the mobile-optimized subdomain:
Allow full site view
To allow your end users to view the full site on mobile, you’ll need to set the value of the following cookie on the root domain only to 0 (zero) at your origin server:
__cf_mob_redir = 0; domain=.example.com
To renew the mobile redirect, delete the cookie, or set it to expire after whatever duration you choose.

