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://%{HTTP_HOST}%{REQUEST_URI} [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://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

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://%{HTTP_HOST}%{REQUEST_URI} [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]

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-2017 Pagely, Inc. All rights reserved.
Pagely® and WordPress® are registered trademarks.

Powered by Zendesk