---
title: How to force https with .htaccess file
description: "#### Force all traffic to use HTTPS To force all traffic on your domain to use HTTPS, simply add the following. If you have existing code in your .htaccess file, you should add this above your current rewrite rules. `RewriteEngine…"
url: "https://support.bluspider.com/kb/how-to-force-https-with-htaccess-file/"
updated: "2024-08-09"
category: WordPress
---

# How to force https with .htaccess file

#### Force all traffic to use HTTPS

To force all traffic on your domain to use HTTPS, simply add the following. If you have existing code in your .htaccess file, you should add this above your current rewrite rules.

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