Nette 2.0.3 and HTTPS problem

6 months 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!

6 months 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)

6 months ago

nightfish
Member | 117
+
+2
-

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

6 months ago

jokumies
Member | 2
+
0
-

Got it! Big thanks to both!