Home CMS Tutorial WordPress How to set up ssl certificate in wordpress

How to set up ssl certificate in wordpress

Jul 13, 2019 pm 02:00 PM

How to set up ssl certificate in wordpress

WordPress is currently a popular website system. Because it is simple and easy to use, even if you do not know programming technology, you can build a website by yourself, which saves both cost and time. As search engine technology improves, websites with security certificates installed are given priority, so more and more websites are beginning to deploy SSL certificates. If you want to deploy an SSL certificate, the rented server must be an independent IP, otherwise it cannot be installed. So, how to deploy an SSL certificate on a WordPress website? This article mainly introduces this issue in detail.

Specific steps for deploying SSL certificates on WordPress websites:

1. Upload the SSL installation certificate to the server;

2. Enter the "Website Directory" and find usr/local In the "website domain name.conf" file in the /Nginx/conf directory, add the following fields to the file:

listen 443 ssl;
ssl_certificate/usr/local/nginx/cert/213979626930477.pem;
ssl_certificate_key /usr/local/nginx/cert/213979626930477.key;
Copy after login

3. Restart nginx. At this time, the SSL configuration has taken effect.

4. Log in to the WordPress website backend, modify the wordpress address and site address, and replace them with https://, as follows:

How to set up ssl certificate in wordpress

5. Change wordpress Replace the website http link with https

HTTPS absolute link replacement: Replace the http link in the wordpress website with https, and put the code below in the theme function.php file. (This replacement is only for internal links, external links are invalid)

How to set up ssl certificate in wordpress

HTTPS relative link replacement: Replace the http link in the wordpress website with a // relative link, that is, referenced in http http resources, https references https resources, and automatically adapts. The code is as follows:

How to set up ssl certificate in wordpress

#6. Set up jumps for http and https

In order to prevent the loss of the weight of the original website, or give the search engine the illusion of duplicate pages , we need to 301 redirect the original http link of the website to https.

Open the "website domain name.conf" file in step 2 and add the following code to the location in the picture:

if ($server_port = 80) {
return 301 https://$server_name$request_uri;
}
if ($scheme = http) {
return 301 https://$server_name$request_uri;
}
error_page 497 https://$server_name$request_uri;
Copy after login

How to set up ssl certificate in wordpress

7. Then add "Nginx" can be restarted. Then you can check whether the setting is successful by visiting the page.

Friendly reminder: After the SSL security certificate is deployed, submit it to the Baidu search resource platform to help search engines adapt to the https path as soon as possible.

For more wordpress related technical articles, please visit the wordpress tutorial column to learn!

The above is the detailed content of How to set up ssl certificate in wordpress. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

The 5 Best IDEs for WordPress Development (And Why) The 5 Best IDEs for WordPress Development (And Why) Mar 03, 2025 am 10:53 AM

Choosing the Right Integrated Development Environment (IDE) for WordPress Development For ten years, I've explored numerous Integrated Development Environments (IDEs) for WordPress development. The sheer variety—from free to commercial, basic to fea

Create WordPress Plugins With OOP Techniques Create WordPress Plugins With OOP Techniques Mar 06, 2025 am 10:30 AM

This tutorial demonstrates building a WordPress plugin using object-oriented programming (OOP) principles, leveraging the Dribbble API. Let's refine the text for clarity and conciseness while preserving the original meaning and structure. Object-Ori

How to Pass PHP Data and Strings to JavaScript in WordPress How to Pass PHP Data and Strings to JavaScript in WordPress Mar 07, 2025 am 09:28 AM

Best Practices for Passing PHP Data to JavaScript: A Comparison of wp_localize_script and wp_add_inline_script Storing data within static strings in your PHP files is a recommended practice. If this data is needed in your JavaScript code, incorporat

How to Embed and Protect PDF Files With a WordPress Plugin How to Embed and Protect PDF Files With a WordPress Plugin Mar 09, 2025 am 11:08 AM

This guide demonstrates how to embed and protect PDF files within WordPress posts and pages using a WordPress PDF plugin. PDFs offer a user-friendly, universally accessible format for various content, from catalogs to presentations. This method ens

See all articles