Nice guide for integrating <a href="https://www.cloudways.com/blog/add-ssl-certificates-to-custom-php-sites/">PHP with SSL</a>. But this doesn't include how to write redirect rules so your http php site is redirect to https urls. You can write the redirect rules in .htacess.