Forcing SSL Redirect HTTP to HTTPS Print

  • 3

Forcing SSL is ideal to enforce security settings. It is recommended that you enable this if you have a valid SSL Certificate installed. Please use the instructions below for your type of web hosting plan Linux or Windows.

NOTE: If using WordPress, you will need to update your HOME / BASE URL while making these changes.

Linux Accounts

ENABLING HTTPS (Linux Hosting)

HTTPS Redirects automatically changes insecure requests (http://) to secure requests (https://). 

To enable HTTPS for your site, follow these steps:

  1. Navigate to the ~/public_html directory.
  2. Open the .htaccess file or create a new one.
  3. Copy the code below, and then paste it into the .htaccess file.
  4. Save your changes to the .htaccess file. HTTPS is now enabled for your site.
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
 

 

Windows Accounts:

Forcing HTTPS (Windows Hosting)

To force SSL for your site using web.config, follow these steps:

  1. Navigate to the wwwroot directory
  2. Open the web.config file.
  3. Copy the following lines into the web.config file. Add these rewrite rules to implement HTTPS in the Web.Config for any domain. 


<system.webServer>
    <rewrite>
        <rules>
            <rule name="Redirect HTTP to HTTPS" stopProcessing="true">
                <match url="(.*)" />
                <conditions>
                    <add input="{HTTPS}" pattern="off" />
                </conditions>
                <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
            </rule>
        </rules>
    </rewrite>
</system.webServer>

 

Contact Support

If you are still having issues, please contact us for further help.
1-877-EPHOST1 | support@ephost.com

 


Was this answer helpful?

« Back