Synology: How to Automatically Redirect HTTP to HTTPS in WordPress

Synology How to Automatically Redirect HTTP to HTTPS in WordPress

Did you install WordPress on your Synology NAS? Have you decided to use your own custom domain name to log into your WordPress website? Have you already added an SSL certificate? Surely you have noticed that, if you type in http://yourowndomainname.com in your browser address bar, you are told that your WordPress site is not using a valid HTTPS/SSL certificate. To solve this problem you will need to follow my instructions below to redirect HTTP to HTTPS.

  • STEP 1

Please Support My Work by Making a Donation.

  • STEP 2

Go to File Station / web folder / wordpress folder / and download the .htaccess file on your computer. Open the .htaccess file with notepad. The file will look like the one in the screenshot below.

1 Redirect HTTP to HTTPS in WordPress

  • STEP 3

At the beginning of the .htaccess file copy/paste the code below:

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

After you copy paste the code above, save the .htaccess file and upload it again in your Synology WordPress folder. Rename the old file .htaccess old and the new file .htaccess

Remember to add the . (dot) at the beginning of the htaccess file name. Follow the instructions in the image below.

2 Redirect HTTP to HTTPS in WordPress

Note: You can use the Synology Text Editor Package downloaded from Package Center to edit the .htaccess file without having to download it in your computer, then upload it again in your WordPress folder.
Note: The instructions above work perfectly with Nextcloud too. You can automatically redirect HTTP to HTTPS by adding the code above at the beginning of the .htaccess Nextcloud file.
Note: To take advantage of the SSL connection it is mandatory to create an SSL certificate in Control Panel / Security / Certificate.

This post was updated on Wednesday / August 10th, 2022 at 10:58 PM