Forcing HTTPS ensures that all traffic to your website is securely encrypted, providing better security for visitors and improving SEO rankings. Follow these steps to force HTTPS on your website using Plesk.
Step 1: Log in to Plesk #
- Open your web browser and go to the Plesk login page.
- Enter your credentials and click Log in.
#
Step 2: Navigate to the Websites & Domains Section #
- In the Plesk dashboard, locate and click on Websites & Domains.
- Select the domain you want to secure.
Step 3: Access Hosting Settings #
- Under the selected domain, click Hosting Settings.
- This will open the hosting configuration page.
Step 4: Enable HTTPS Redirect #
- In the Hosting Settings page, locate the Security section.
- Check the box for Permanent SEO-safe 301 redirect from HTTP to HTTPS.
- Ensure the SSL/TLS certificate dropdown has the correct certificate selected for your domain.
- Click OK or Apply to save the changes.
#
Step 5: Verify the Redirect #
- Open a web browser and enter your domain using
http://
(e.g.,http://yourdomain.com
). - Confirm that the browser automatically redirects to
https://
. - Check for the padlock icon in the address bar to ensure the connection is secure.
Alternative Method: Using .htaccess #
If your hosting setup requires manual configuration or you need custom rules, you can force HTTPS using the .htaccess
file:
- Navigate to the File Manager in Plesk.
- Open the httpdocs folder and locate the
.htaccess
file. - Add the following lines to the file: <pre>
<code>
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]</code> </pre> - Save the changes and test the redirect as described above.
Tips #
- Always back up your
.htaccess
file before making changes. - Use a 301 redirect for SEO benefits, as it informs search engines of the permanent change.
- Verify that your SSL certificate is valid and installed correctly before enabling HTTPS.