How do I force visitors of my site to always use HTTPS?

An SSL certificate is included in the Beginner plan and higher and will be issued and activated for domains using one.com's name servers. This means that besides HTTP, HTTPS will also work for your site with us.

In this guide, we show you how to automatically redirect HTTP to HTTPS, ensuring that your website visitors always use HTTPS.


Step 1 - Go to File Manager in the Control Panel

  1. Log in to the one.com Control Panel.
  2. On the Files & Security tile, click File Manager.

Step 2 - Create an .htaccess file

  1. Click the small down arrow next to the blue button and select New other file.
  2. Name the file .htaccess, beginning with a dot. 

Note: If you already have an existing .htaccess file on your web space, you don't need to create a new file. Instead you can edit the existing file.

new-other-file.png


Step 3 - Edit the .htaccess file

Select the .htaccess file and click Edit at the top of the screen to open the text editor. 

edit-htaccess.png


Step 4 - Paste in the configuration

Paste the configuration below in the text editor, and click Save at the top of the screen.

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

rewrite-https.png


Step 5 - Done!

All done! Open your site in a browser and click on the security lock to confirm the connection is secure.

Your website is now served over HTTPS


Related articles:

Was this article helpful?

Can’t find what you are looking for?

Start a chat

It's the quickest way to get in touch, every day of the year.

Give us a call

Available on weekdays from 10am to 2pm (UTC).