Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

HTTP to HTTPS redirect for WordPress on Azure Web App on Linux

If you host WordPress site on Azure Web App on Linux running Apache, here are the steps to implement HTTP to HTTPS redirect:

1. Add RewriteRule in .htaccess in WordPress application root

 RewriteCond %{HTTP:X-ARR-SSL} ^$
 RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

2. Once this RewriteRule is added, you may see wp-admin page lost style like this, this is caused by loading mixed content from http and https,

Here is a way to fix this, add following code in wp-config.php,

define('FORCE_SSL_ADMIN', true); 
if ( isset($_SERVER['HTTP_X_ARR_SSL']) ) 
        $_SERVER['HTTPS']='on';

Share the post

HTTP to HTTPS redirect for WordPress on Azure Web App on Linux

×

Subscribe to Msdn Blogs | Get The Latest Information, Insights, Announcements, And News From Microsoft Experts And Developers In The Msdn Blogs.

Get updates delivered right to your inbox!

Thank you for your subscription

×