Alibaba Cloud Lightweight Application Server Installation of WordPress (03) Installation of SSL Certificate Causes Theme Style Loss Solution, Wordpress Multilingual Plug in

One year ago (2023-11-28) Chief Editor
7 minutes
three hundred and ninety-three
zero

Author: The little princess is in a very good mood

The content of this article is suitable for people like me who have no experience in building WordPress and know nothing about "building a website". What this article highlights is what a Xiaobai should do, including his writing style, which is mainly to restore his mental journey at that time. Of course, I will also make a concise version at the end of the article.

With Alibaba Cloud's lightweight application server, you can install WordPress applications in one step, but the real pitfall is just beginning. For example, applying for domain names, adding certificates, filing, etc

As a rule, let's first review the history of the SSL certificate related problems I encountered after installing WordPress using Alibaba Cloud lightweight application servers.

Mental version

It took me a lot of time to get the SSL certificate free of charge, and the website was also accessed using HTTPS encryption. But when I opened my WordPress excitedly, I saw a mess. The original theme I carefully selected could not be shown at all, and the website became a pure text form.

As a white man, my first reaction was that I had problems with my previous operations. I did not hesitate to restore the previously modified files, and everything was normal after HTTP access. The problem remains after the HTTPS access is changed after the re operation. Then I realized that it was not my previous operation mistake... Of course, this time I directly chose the third online search!

But I didn't know what the problem was or what keywords to search for. It took me a lot of time. In my understanding, the conclusion is that the theme style and image links in WordPress contain http addresses, which cannot be displayed under HTTPS encrypted access, and must be modified. The modification methods include database related operations that I can neither understand nor know where.

Fortunately, after comparing several tutorial versions, we have sorted out such a solution:

1、 Use WinSCP to access the server file directory and directly find the/data/wwwroot/wordpress/wp includes/functions.php file for editing.

2、 Edit the functions.php file:

Find code:

require ABSPATH . WPINC . / option.php;

Copy and paste the following code below:

add_filter(script_loader_src, agnostic_script_loader_src, 20,2);  

function agnostic_script_loader_src($src, $handle) { 

    return preg_replace(/^(http|https):/, $src);  

add_filter(style_loader_src, agnostic_style_loader_src, 20,2);  

function agnostic_style_loader_src($src, $handle) { 

    return preg_replace(/^(http|https):/, $src);

}

The final effect is as follows:

Click Save in the upper left corner.

3、 Use WinSCP to access the server file directory and directly find the/data/wwwroot/wordpress/wp-config.php file for editing.

4、 Edit the wp-config.php file:

Find code:

*

* @package WordPress

*/

Copy and paste the following code below:

$_SERVER[HTTPS] = on;

define(FORCE_SSL_LOGIN, true);

define(FORCE_SSL_ADMIN, true);

The final effect is as follows:

Click Save in the upper left corner.

5、 Enter the lightweight application server background and restart the server to make the above changes take effect. Then enter the WordPress background and modify the WordPress address (URL) ② and site address (URL) ③ to //your domain name (originally //your domain name or IP address) in Settings ① - General.

Attachment 1: Don't forget to add your domain name. Don't just write //as shown in the figure, and think it's done... The correct form should be similar //example.com In this way. Wrong writing, saving is a big hole

Attachment 2: If you only read this article, I'm afraid you forgot the problem of domain name resolution. Please note that this is the third article, and there are two previous articles. If it is really a little white like me, please read it from the beginning before operating.

6、 Save the changes, and then enter the lightweight application server background to restart the server.

If you enter WordPress at this time and no theme style or picture is displayed, you can switch to another theme temporarily first and then switch back.

Concise version

Locate the/wp includes/functions. php file; Add a piece of code to solve the problem of missing theme style (you still need to see the previous mental chapter for details of graphics and text and code).

Locate the/wp-config.php file; Add a piece of code to solve the background login problem (you still need to see the previous mental chapter for details of graphics and text and code).

Enter the WordPress background, and modify the WordPress address (URL) and site address (URL) to //your domain name (originally //your domain name or IP address) in Settings - General.

Some remarks

Many online tutorials mention that installing a really simple ssl plug-in into WordPress can be a more perfect solution. However, as a Xiaobai, I can only install the plug-in, but I don't know how to use it. I don't actually use the plug-in, but I can still solve the problems I have encountered. So we will study it when necessary, and update it at that time.

This article is written by: Chief Editor Published on Software Development of Little Turkey , please indicate the source for reprinting: //hongchengtech.cn/blog/957.html
Kuke_WP editor
author

Related recommendations

1 year ago (2024-02-20)

Multi store system management - store management design, how to do multi store system design scheme

Store management is an important part of the e-commerce platform. The platform administrator manages store information, goods, orders, settlement methods and other contents through the store management function. The author of this paper analyzes the design of store management in multi merchant system management. Let's have a look. 1、 Introduction The store management is an important part of the e-commerce platform. The platform administrator manages the store through
seven hundred and twenty-two
one
1 year ago (2024-02-19)

Sitecore: What major functions does a high-quality and powerful content management system need to have?

An appropriate content management system (CMS) is an urgent task for enterprises to maintain competitiveness through digital upgrading and transformation. Now 90% of enterprise website building and development uses CMS, which can easily create excellent customer experience in all channels, help enterprises attract new customers, retain old customers and turn existing customers into loyal customers, expand market share and increase revenue
three hundred and seventy-eight
zero
1 year ago (2024-02-18)

The combination and application of content management system and marketing technology, and the combination and application of content management system and marketing technology

B2B content marketing hopes to deliver valuable content to customers at their own stage in a timely manner during their purchase journey. Such as brand and solution related content in the cognitive stage, industry cases in the consideration stage and user confidence building stage, in-depth service introduction in the purchase stage, etc. These contents include images, videos, web pages, white papers
three hundred and seventeen
zero
1 year ago (2024-02-18)

In the second quarter, 648 websites were interviewed by the national network information system according to law, 56 websites were suspended from updating, and the spirit of the national network information work conference was ppt

According to the data released by "Cybertrust China", in the second quarter, the national Cybertrust system continued to strengthen administrative law enforcement, standardize administrative law enforcement, and investigate and deal with all kinds of illegal cases according to law. Original title: In the second quarter, 648 websites were interviewed by the national online trust system in accordance with the law, 56 websites were suspended from updating, and the TechWeb news on July 30 was released according to "online trust China"
three hundred and eleven
zero
1 year ago (2024-02-17)

Introduction and recommendation of ten free cms website building systems, and ten free defective software

It is particularly important to choose a easy-to-use cms website building system for website management and maintenance. We will choose different website building systems according to different website types, but the load, security, ease of use, versatility and subsequent development of the program are all basic criteria for everyone to choose a website building system. According to the webmaster station ranking and aleax ranking, the top 1
three hundred and seventy-six
zero
1 year ago (2024-02-17)

What are the advantages of Shanghai cms website?, How to build a website for cms

Original title: What are the benefits of building a website by Shanghai cms? Before the advent of cms, we usually found a website production company to carry out customized development. It can also be said that in fact, these website production companies also have their own formed website construction system, but it is not available for users to download. What we are talking about now is a website construction system that can be downloaded to build websites
three hundred and twenty-two
one

comment

0 people have participated in the review

Scan code to add WeChat

contact us

WeChat: Kuzhuti
Online consultation: