Force HTTPS on Yii2
问题 Requirement How to forcibly redirect to https (redirect if user accessing http) on Yii2? I already tried web.config to force https, but it didn't work. scenario I am using Yii2 advanced app hosted on IIS 7.5. 回答1: Its actually very easy in Yii2 as there is a predefined method for your check. Just three steps needed: 1. Extend the application class Extend the default yii web-application class and override the handleRequest -method. Use the existing Yii2-function to check if the connection is