Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentes Révision précédente | |||
|
web-dev:truc-astuces [d/m/Y H:i] sylvain |
web-dev:truc-astuces [d/m/Y H:i] (Version actuelle) sylvain |
||
|---|---|---|---|
| Ligne 50: | Ligne 50: | ||
| RewriteRule /?(.*) http://www.guaph.net/$1 [R=301,L] | RewriteRule /?(.*) http://www.guaph.net/$1 [R=301,L] | ||
| </code> | </code> | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | **Forcer le HTTPS pour un répertoire / un dossier** | ||
| + | <code> | ||
| + | # admin HTTPS | ||
| + | RewriteCond %{HTTPS} !on | ||
| + | RewriteRule (admin/) https://%{HTTP_HOST}/$1 [R,L] | ||
| + | </code> | ||
| + | |||
| + | **Forcer le HTTPS pour un fichier** | ||
| + | <code> | ||
| + | # page HTTPS | ||
| + | RewriteCond %{HTTPS} !on | ||
| + | RewriteRule (page\.php) https://%{HTTP_HOST}/$1 [R,L] | ||
| + | RewriteRule (repertoire/page\.php) https://%{HTTP_HOST}/$1 [R,L] | ||
| + | |||
| + | # Sortie du HTTPS (facultatif) | ||
| + | RewriteCond %{HTTPS} on | ||
| + | RewriteCond %{REQUEST_URI} !^/page\.php$ | ||
| + | RewriteCond %{REQUEST_URI} !^/repertoire/page\.php$ | ||
| + | RewriteRule (.*) http://%{HTTP_HOST}/$1 [R,L] | ||
| + | </code> | ||
| + | |||
| + | |||
| + | |||
| **Pages d'erreurs** | **Pages d'erreurs** | ||