Quantcast
Channel: Active questions tagged https - Stack Overflow
Viewing all articles
Browse latest Browse all 1535

Yii2 https URLs do not work

$
0
0

I try to run my local copy of my yii2 site with https. I use this in config to force http url to https

'on beforeRequest' => function ($event) {    if(!Yii::$app->request->isSecureConnection){        $url = Yii::$app->request->getAbsoluteUrl();        $url = str_replace('http:', 'https:', $url);        Yii::$app->getResponse()->redirect($url);        Yii::$app->end();    }},

The only url I can reach is the home page i.e. a bare url such as example.extOther URLs give

Not Found The requested URL /site/index was not found on this server.

When removing the 'onbeforerequest' in the config, I can reach every http URL.Question: why https URLs become unreachable?


Viewing all articles
Browse latest Browse all 1535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>