Sunday, July 11, 2021

How to solve CSS loading issue after implementing AWS ALB | CSS not Loading after AWS ALB in Wordpress

 

How to solve CSS Loading issue After implementing AWS ALB


=> Why this issue is happening : Whenever we use ALB to manage our website traffic like http or https first all request goes to ALB only and ALB manage all traffic, means  user get https reply but ALB send only http request on backend server and we don't have https enabled on server so server not able to respond in same way because of this we started facing CSS not loading issue or broken site pages or "ERR_TOO_MANY_REDIRECTS"


How to solve this issue : You can solve this issue by using  
                                          HTTP_X_FORWARDED_PROTO by doing modification in wordpress configuration as given below .


=> Update Your wordpress configuration 


define('WP_HOME','https://www.makelinuxinteresting.com/');
define('WP_SITEURL','https://www.makelinuxinteresting.com/');

// Below is the code which you have to implement in wp-config.php
if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false)
       $_SERVER['HTTPS']='on';


Note : After implementing this code make sure you clear your browser cache or use private windows. 




3 comments:

  1. VPS or Virtual Private Server facilitating plans is a further developed decision than the common plans. This is a choice more satisfactory for medium-sized organizations that will have more die hard commitment.https://onohosting.com/

    ReplyDelete
  2. This article is actually remarkable one it helps many new users that desire to read always the best stuff. ZoopUp.

    ReplyDelete
  3. This article is actually remarkable one it helps many new users that desire to read always the best stuff. ZoopUp.

    ReplyDelete

Installing Jenkins on RHEL 8 is a straightforward process. Here's a step-by-step guide

Introduction  Jenkins is an open-source automation server widely used for continuous integration (CI) and continuous delivery (CD) pipelines...