0

i am doing migration of my website from http to https . now static files are coming from http schema . example

<script type='text/javascript' src='http://demo.com/news/wp-includes/js/comment-reply.min.js?ver=4.9.6'></script>
<script type='text/javascript' src='http://demo.com/news/wp-includes/js/wp-embed.min.js?ver=4.9.6'></script> 

it should be

 <script type='text/javascript' src='https://demo.com/news/wp-includes/js/comment-reply.min.js?ver=4.9.6'></script>
    <script type='text/javascript' src='https://demo.com/news/wp-includes/js/wp-embed.min.js?ver=4.9.6'></script> 

i added

remove_filter('template_redirect', 'redirect_canonical');

to remove redirection because it load from aws cloud front . what i have to do to load all css/js from https ?

1
  • How did you do the migration exactly? Have you changed the URL's in the WordPress settings pages to switch from HTTP to HTTPS? Commented Jun 30, 2018 at 19:05

1 Answer 1

0

It depends on how you included these scripts on your website. Did you include them directly on your theme files (i.e. footer.php, header.php) or did you use wp_enqueue_script on your functions.php?

In the first case, you have to manually update these script URLs to https while please make sure you've updated your WordPress and Site Address to https on the latter.

1
  • In the first case you should definitely fix that and start using wp_enqueue_script ;) Commented Jul 6, 2018 at 10:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.