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