Search code examples
php.htaccessnginxmigration

Basic Site Missing Elements after Migration


I have just migrated our website to a new server, upon doing this the site is missing background and a bunch of elements. I really know very little about PHP but from my newb diagnose it seems to me it could be in the configuration of that.

The website is - https://amandabernstein.com/

Anything to point me in the direction of resolving this or even diagnosing would be amazing. Server was Cpanel now Plesk.

Thanks in advance.


Solution

  • The problem is that you are trying to load static resources over HTTP when the site is viewed over HTTPS - the browser is triggering a mixed content warning and blocking the resource. Your site is not currently HTTPS-ready.

    This isn't specifically about the "migration", but because you are redirecting to HTTPS.

    When you move to HTTPS everything else also has to be HTTPS as well - HTTPS everywhere - not just the main target URL you see in the browser's address bar.

    You probably have http:// hardcoded in your resource URLs. This needs to be changed to https://.

    On modern browsers, you can set the following HTTP response header on the initial response to instruct the browser to automatically upgrade the HTTP request to HTTPS which will avoid this browser warning.

    Content-Security-Policy: upgrade-insecure-requests;
    

    For example, you can set this in .htaccess with the following directive:

    Header always set Content-Security-Policy "upgrade-insecure-requests;"
    

    But note that this will not upgrade any outbound anchors or help old browsers that don't support this header.