CSS and JS not working over HTTPS in cakephp 2.2.6

58 views Asked by At

I am trying to load css and js files to my project running on localhost through https and CakePHP 2.3 but whenever I enter into my index page, it comes with no styling and with no scripts being loaded. How can I import all my styles and scripts through an https protocol ?

    //Activate the CSS
    echo $this->Html->css(
        array(
            'bootstrap.min',
            'ui-lightness/jquery-ui-1.8.23.custom', 
            'styles_omatech.css?v=2',
            'shadowbox/shadowbox','dcsmt',
            'facebox',
            'jquery.ui.timepicker',
            'goalProgress',
            //NUEVOS CSS
            '/js/intl-tel-input/build/css/intlTelInput.css?1.0.2',
            'admin/sweetalert',
            'font-awesome',
            'awesome-bootstrap-checkbox',
            'bootstrap-select.min',
            'bootstrap-slider',
            'share/jquery.share',
            'star-rating',
            'webfont.css?v=201730100002',
            'style.css?v=1.2.7',
            'media.css?v=1.1.4',
            'td_line_icons/css/td_line_icons.css?v=201808080001',
            'https://cdn.rawgit.com/michalsnik/aos/2.1.1/dist/aos.css' // Library AOS (Animation On Scroll) //
        )
    );
    echo $this->element('dynamic_text_style');
    echo $this->Html->script(array(
        'https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js',
        'https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js',
        'goalProgress.min',
        'admin/sweetalert.min',
        'share/jquery.share',
        'star-rating.min',
        'to_top',
        'legacy',
        'jquery.lazyload.min',
        'theme.js?v=1.0.8',
        'fabric',
        'intl-tel-input/build/js/intlTelInput.js?1.0.1',
        'https://cdn.rawgit.com/michalsnik/aos/2.1.1/dist/aos.js' // Library AOS (Animation On Scroll) //
        )
    );

This is how I load them, first of all I echo the css files and after I insert the js files. Whatsoever, I don't know why this happens and here I also I am attaching you the configuration file so you can have a better glimpse of what I want to make.

   case 'mywebsite.col':
    define('DIR_APLI', '/var/www/mywebsite/trunk');
    define('URL_APLI', HTTP_PROTOCOL.'mywebsite.col');
    define('URL_APLI_WWW', HTTP_PROTOCOL.'mywebsite.col');
    define('IMAGE_APLI', HTTP_PROTOCOL.'mywebsite.col');


  //this is for the Nginx server
 if(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https'){
    define('HTTP_PROTOCOL', 'https://');
    define('HTTP_PROTOCOL_WWW', 'https://www.');
  } else {
    if(!empty($_SERVER['HTTPS'])) {
       define('HTTP_PROTOCOL', 'https://');
       define('HTTP_PROTOCOL_WWW', 'https://www.');
     } else {
    define('HTTP_PROTOCOL', 'https://');
    define('HTTP_PROTOCOL_WWW', 'https://www.');
    }
  } 

Thanks in advance.

0

There are 0 answers