Nette 2.0.3 and HTTPS problem

21 days ago

jokumies
Member | 2
+
0
-

Hi all,

I have an old site using Nette 2.0.3. I'm trying to switch the site to HTTPS but for some reason the site always keeps redirecting to HTTP version.

If my .htaccess is empty, then it redirects to HTTP when accessed with HTTPS.

If I add HTTP → HTTPS redirect to my .htaccess, then it gets into a infinitive http<->https redirect loop.

So how can I either remove that redirect or set HTTPS as the default?

Thanks!

21 days ago

Myiyk
Member | 321
+
0
-

Hi,
in router must be added flag SECURED

https://doc.nette.org/en/2.0/routing#…

Last edited by Myiyk (2018-05-04 18:32)

21 days ago

nightfish
Member | 98
+
+2
-

You can set Route::SECURED flag for all routes by Route::$defaultFlags |= Route::SECURED;

21 days ago

jokumies
Member | 2
+
0
-

Got it! Big thanks to both!