Topic in SSL Management

Force SSL or non SSL/HTTPS

Last Updated -


Our system is globally load balanced and does not utilize the standard HTTPs headers.

To force https, modify your main .htaccess file as

RewriteCond %{HTTP:X-Pagely-SSL} off
RewriteRule ^(.*)$ https://yourdomain.com/$1 [R=301,L]

NOTE: Forcing HTTP will only work if you have a custom SSL already installed. If the browser goes to your site it will warn of a SSL mismatch before the .htaccess file is used.

And to force only http use:

RewriteCond %{HTTP:X-Pagely-SSL} on
RewriteRule ^(.*)$ http://yourdomain.com/$1 [R=301,L]

In both cases replace yourdomain.com with your actual domain name.

It is important to place the code in the correct location to allow the redirect to happen before wordpress handles the request. Please review the following example and adjust according to your current setup.

NOTE: This example is for force HTTPS on all requests.

RewriteCond %{HTTP:X-Pagely-SSL} off
RewriteRule ^(.*)$ https://yourdomain.com/$1 [R=301,L]

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

Related Topics

Pagely is the Managed WordPress Hosting Platform designed to exceed the needs of media, business, and Enterprise customers alike. We help the world's biggest brands scale WordPress.

Copyright © 2006-2016 Pagely, Inc. All rights reserved.
Pagely® and WordPress® are registered trademarks.

Pagely
Powered by Zendesk