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. 




5 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
  4. This well-crafted article contains highly useful information. It stands to benefit anyone who makes use of it, myself included. Please continue delivering such valuable content. ZoopUp.

    ReplyDelete
  5. Thank you for sharing! Your solution to the CSS loading issue is invaluable for website development. Clear instructions like these make troubleshooting easier for developers. Great job

    ReplyDelete

Linux server hardening | Secure Linux Servers

 Linux server hardening is the process of securing a Linux server by reducing its attack surface and mitigating security risks. The goal is ...