• Hi!

    I have been fiddling around with Azure web apps lately, and trying to setup a WordPress app.

    It seems that when using “WordPress on Linux”, enforcing HTTPS is not working. The forms in wp-login.php is still pointing to http and so the browsers block it. Thus making it impossible to login.

    This is not the case when using the “WordPress” app. It seems to work very well using that one.

    <form name="loginform" id="loginform" action="https://wplinux123.azurewebsites.net/wp-login.php" method="post">

Viewing 2 replies - 1 through 2 (of 2 total)
  • If you host a WordPress site on Azure Web App on Linux running Apache, here are the steps to implement an 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 your /wp-admin page displaying like this, which is caused by loading mixed content from http and https:

    View post on imgur.com

    3. Next, add the following code in your wp-config.php file:

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

    (@hasselrot)

    Hi!

    Thank you, I will give this a try!

    I am wondering, since both apps are provided by WordPress.
    How come the one called “WordPress on Linux” is not preconfigured with this, when the other one is?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘HTTPS when using “WordPress on Linux” Azure Web app’ is closed to new replies.