HTTPS redirection
For securing communications with your visitors, we recommend redirecting visits to your site using HTTPS.
Requirements
a Web Hosting service
an OnetSolutions account
Instructions
To achieve this, you can modify or create the .htaccess file in your website's root directory and add the following code:
This code snippet checks if the X-Forwarded-Proto header is not set to "https" and if the HTTPS environment variable is not enabled. If both conditions are met, it redirects the visitor to the HTTPS version of the site using a 301 (Permanent) redirect.
To ensure the security of your entire content, including images and other assets, it's essential to update any references or links to use the HTTPS protocol instead of HTTP. This ensures that all elements on your website are loaded securely over HTTPS.
By implementing these steps, you can enforce HTTPS for your site, providing a secure browsing experience for your visitors and safeguarding their interactions with your website.
Last updated
Was this helpful?