Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentes Révision précédente Prochaine révision | 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 1: | Ligne 1: | ||
| + | ===== .htaccess ===== | ||
| + | * [[http://alexandre.alapetite.net/doc-alex/redirections/index.fr.html#apache|Redirection HTTP avec Apache]] (.htaccesss) | ||
| + | |||
| + | |||
| + | **Forcer php 5** | ||
| + | <code> | ||
| + | SetEnv PHP_VER 5 | ||
| + | </code> | ||
| + | |||
| + | **erreurs PHP** | ||
| + | <code> | ||
| + | # erreurs PHP | ||
| + | php_flag display_errors on | ||
| + | #php_flag register_globals on | ||
| + | php_flag register_long_arrays on | ||
| + | </code> | ||
| + | |||
| + | |||
| + | **Augmenter l'upload** | ||
| + | <code> | ||
| + | php_value upload_max_filesize 75M | ||
| + | php_value post_max_size 75M | ||
| + | </code> | ||
| + | |||
| + | |||
| + | **Définir les index et leur ordre de priorité** | ||
| + | <code> | ||
| + | DirectoryIndex index.php index.php3 index.html index.htm | ||
| + | </code> | ||
| + | |||
| + | |||
| + | **Interdire l'accès** | ||
| + | <code> | ||
| + | Deny From ALL | ||
| + | </code> | ||
| + | |||
| + | |||
| + | **redirection permanente** | ||
| + | <code> | ||
| + | Redirect permanent /dossier/fichier.html http://wiki.guaph.net/ | ||
| + | </code> | ||
| + | |||
| + | |||
| + | **Rédirection du domaine.tld vers www.domaine.tld** | ||
| + | <code> | ||
| + | RewriteEngine On | ||
| + | |||
| + | RewriteCond %{HTTP_HOST} ^guaph.net$ | ||
| + | RewriteRule /?(.*) http://www.guaph.net/$1 [R=301,L] | ||
| + | </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** | ||
| + | |||
| + | * 401 : Authorization required | ||
| + | * 403 : Forbidden | ||
| + | * 404 : Not Found | ||
| + | * 406 : Request Timed Out | ||
| + | * 500 : Internal Server Error | ||
| + | * 503 : Service Unavailable | ||
| + | <code> | ||
| + | ErrorDocument 404 /404.html | ||
| + | </code> | ||