> ## Documentation Index
> Fetch the complete documentation index at: https://help.onetsolutions.net/llms.txt
> Use this file to discover all available pages before exploring further.

# HTTPS Redirection

> Redirect HTTP traffic to HTTPS for secure connections

For securing communications with your visitors, we recommend redirecting all HTTP traffic to HTTPS.

<Info>
  **Prerequisites**

  * A Web Hosting service with OnetSolutions
  * An SSL certificate installed (free SSL is included with all hosting plans)
</Info>

## Why Use HTTPS?

<CardGroup cols={3}>
  <Card title="Security" icon="shield">
    Encrypts data between visitors and your server
  </Card>

  <Card title="SEO Boost" icon="chart-line">
    Google ranks HTTPS sites higher in search results
  </Card>

  <Card title="Trust" icon="badge-check">
    Shows the padlock icon in browsers
  </Card>
</CardGroup>

## Setting Up HTTPS Redirection

<Note>
  Add the following code to your `.htaccess` file in your website's root directory.
</Note>

```apache theme={null}
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTPS} !on
RewriteRule ^(.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
```

<Accordion title="How it works">
  This code:

  1. Checks if the `X-Forwarded-Proto` header is not set to "https"
  2. Checks if the HTTPS environment variable is not enabled
  3. If both conditions are met, redirects the visitor to the HTTPS version using a 301 (Permanent) redirect
</Accordion>

## Additional Steps

<Warning>
  After enabling HTTPS, update all internal links, images, and assets to use `https://` instead of `http://` to avoid mixed content warnings.
</Warning>

<Tip>
  You can also enable HTTPS redirection through cPanel's "Redirects" feature or by enabling "Force HTTPS" in your domain settings.
</Tip>
