📜 ⬆️ ⬇️

Wordpress + CloudFlare - fresh move to https

It has long been translating all sites to https. The other day, the task of transferring another site to Wordpress again arose. I am writing on fresh memory relevant instructions on the move.


What is https and why you will not need to write it, the Internet is full of information on this topic. In short, you definitely need it :) Even if your site interacts with the user only with its menu and links in articles, it still remains at least 1 reason to make the move - traffic from the organic search results. Search engines prefer https sites.


What we need to have in order to carry out our plans:



Go


First back up your entire site and database!


First we need to register on the service Cloudflare.com . Next, add your website to the form “Set Up Websites” and click “Begin Scan”. The service will begin scanning domain dns records. Usually, everything passes normally and CloudFlare itself finds all the records, but in my case it did not happen :) Most likely, the hoster's server was somehow crookedly cleverly configured. Although everything looked through the DNS look up services, CloudFlare did not manage. But it does not matter. The domain is ours, and we know what is going to happen to it.


At a minimum, you should have a record of the form:

A domain.ru 000.000.000.000 

where A is the record type, domain.ru is your domain name without www, 000.000.000.000 is your server’s ip address (you can usually ping the first Name server - ns1.reg.ru or ns1.nic.ru depending on your hosting - in windows start - execute - cmd / k ping ns1.nic.ru)


This entry can be added manually.


If you have Yandex mail connected for a domain, do not forget to add the MX record. To add an alias “www” add an entry:


 CNAME www domain.ru 

where domain.ru is replaced with your domain.


After adding the site, CloudFlare will inform you about the new ns servers that you will need to specify for your domain in the domain control panel.


Go to the domain control panel - change DNS records (DNS server) and change the old value to those that told us CloudFlare.


We return to CloudFlare, go to our website, tab “Crypro” and in the first paragraph “SSL” choose “Flexible”


Next, go to the admin Wordpress - Plugins - Add a new one. Install and activate 3 new plugins:



Cloudflare plugin


Choose a plugin in Settings - CloudFlare. You must enter the email address that you provided when registering with CloudFlare and the service API. API take on the site CloudFlare.com. In the upper right corner, click on your name - My settings - Global API Key - View API Key. Copy, paste in Wordpress. The plugin is authorized, then you need to press just one button in the first paragraph “Apply Default Settings” - “Apply”


Better Search Replace Plugin


If your site has external links or images, skip this step !!!


Choose a plugin in the Wordpress Tools menu - Better Search Replace. In the “Search for” field we enter “http: //” without quotes, and in the “Replace with” field - “https: //” without quotes. We select all the tables, put the checkbox “Case insensitive”, remove the checkbox “Idle launch? (without replacement) ”, click“ Start Search / Replace ”. Thus, we will replace all the links of the old protocol with the new one in the menu, materials, plugin settings, everywhere.


The final touch.


We go to the Wordpress settings - General and change the "WordPress Address (URL)" and "Website Address (URL)" from ... To ... (without three dots, the values ​​remain yours, you need to add the letter "s" to these http fields)


Is done. As soon as the dns-records on the servers of the providers are updated (up to 48 hours), your site will work via https!


')

Source: https://habr.com/ru/post/322108/


All Articles