1

I just upload my site https://watson-applications-hossp.ondigitalocean.app/ to digital ocean. For some reason, my styling is not syncing up, but my images are showing up.

My index.php, which is in my root:

<?php
session_start();

$path = $_SERVER['REQUEST_SCHEME']."://".$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF'];
$path = str_replace("index.php", "", $path);

define('ROOT', $path);
define('ASSETS', $path."assets/");
include "app/init.php";
$app = New App();
?> 

My assets folder is also in my root. In this folder, I have a folder for images and one for styling. In developing and testing on localhost, styling is there.

Even though I am using PHP, I am not using Laravel.

I did trying to manually add the location of the css files, but that didn't work.

head in head.php

<link rel="stylesheet" href="<?= ASSETS ?>css/bootstrap.min.css">
    <link rel="stylesheet" href="<?= ASSETS ?>css/owl.carousel.min.css">
    <link rel="stylesheet" href="<?= ASSETS ?>css/magnific-popup.css">
    <link rel="stylesheet" href="<?= ASSETS ?>css/font-awesome.min.css">
    <link rel="stylesheet" href="<?= ASSETS ?>css/themify-icons.css">
    <link rel="stylesheet" href="<?= ASSETS ?>css/nice-select.css">
    <link rel="stylesheet" href="<?= ASSETS ?>css/flaticon.css">
    <link rel="stylesheet" href="<?= ASSETS ?>css/gijgo.css">
    <link rel="stylesheet" href="<?= ASSETS ?>css/animate.min.css">
    <link rel="stylesheet" href="<?= ASSETS ?>css/slick.css">
    <link rel="stylesheet" href="<?= ASSETS ?>css/slicknav.css">
    <link rel="stylesheet" href="<?= ASSETS ?>css/style.css">

What is going on?

Watson
  • 59
  • 1
  • 1
  • 4
  • Personally I'd just change $_SERVER['REQUEST_SCHEME']."://". to HTTPS. But the problem is REQUEST_SCHEME is returning HTTP instead of HTTPS. - this is an apache issue, not a PHP issue. If you're using Google Chrome, press F12 and go to the Console and it will show you that the content isn't being loaded as it's coming over HTTP instead of HTTPS. https://i.imgur.com/tBlQeE8.png – Laim May 12 '23 at 17:37

0 Answers0