Skip to content

Commit dd9068d

Browse files
Jan Galekdg
authored andcommitted
Added new description about HTTPS (#454)
* Added substitude for $defaultFlags * Correction * Fixed alternative for Route:$defaultFlags * Added HTTPS
1 parent 07d027c commit dd9068d

File tree

2 files changed

+52
-1
lines changed

2 files changed

+52
-1
lines changed

cs/routing.texy

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,32 @@ Navíc dojde k automatickému přesměrování na nový tvar URL, takže vám ty
296296

297297
HTTPS
298298
-----
299+
Abychom mohli používat HTTPS protokol, je nutné si správně nakonfigurovat server.
299300

300-
*TODO*
301+
Přesměrování všech adres u již zaběhnuté aplikace lze docílit pomocí souboru .htaccess v kořenovém adresáři naší aplikace za použití permanentního přesměrování s kódem 301.
302+
303+
/--php
304+
<IfModule mod_rewrite.c>
305+
RewriteEngine On
306+
...
307+
RewriteCond %{HTTPS} !=on
308+
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L, R=301]
309+
...
310+
</IfModule>
311+
\--
312+
313+
Routy generují URL se stejným protokolem, s jakým byla stránka načtena. Potřebujeme-li, aby na určité adresy byl použit jiný protokol, použijeme ho v masce routy.
314+
315+
/--php
316+
// Přesměrování na HTTP protokol
317+
$route = new Route('http://%host%/<presenter>/<action>','Homepage:default');
318+
319+
// Přesměrování na HTTPS protokol
320+
$route = new Route('https://%host%/<presenter>/<action>','Admin:default');
321+
\--
322+
323+
.[caution]
324+
HTTPS musí podporovat váš hosting.
301325

302326

303327
Transformace a překlady

en/routing.texy

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,35 @@ $router[] = new Route('product/<id>', 'Product:detail');
358358
\--
359359

360360

361+
HTTPS
362+
-----
363+
We need configurate our server for use HTTPS protocol.
364+
365+
366+
Forward all addresses for already well-established applications can be achieved by using .htaccess file in the root directory of our application using a permanent redirect with code 301.
367+
368+
/--php
369+
<IfModule mod_rewrite.c>
370+
RewriteEngine On
371+
...
372+
RewriteCond %{HTTPS} !=on
373+
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L, R=301]
374+
...
375+
</IfModule>
376+
\--
361377

378+
Routes generate URLs with the same protocol, which the page was loaded. If we need, so that certain addresses use other protocol, we use them in mask of route.
362379

380+
/--php
381+
// Forwarding to HTTP protocol
382+
$route = new Route('http://%host%/<presenter>/<action>','Homepage:default');
383+
384+
// Forwarding to HTTPS protocol
385+
$route = new Route('https://%host%/<presenter>/<action>','Admin:default');
386+
\--
387+
388+
.[caution]
389+
HTTPS musí podporovat váš hosting.
363390

364391

365392
Filters and Translation

0 commit comments

Comments
 (0)