Anciennes révisionsLiens de retourExporter en PDFHaut de page Share via Share via... Twitter LinkedIn Facebook Pinterest Telegram WhatsApp Yammer RedditDerniers changementsSend via e-MailImprimerPermalien × Apache Tutorial: protections: .htaccess / .htpasswd files http://httpd.apache.org/docs/2.0/howto/htaccess.html https://lehollandaisvolant.net/?d=2021/05/04/22/18/42-quelques-astuces-htaccess howto htpasswd -c .htpasswd userName then protect whole directory: AuthUserFile /directory/.htpasswd AuthGroupFile /dev/null AuthName - AuthType Basic <Limit GET POST PUT> require valid-user </Limit> protect file/s: <FilesMatch "a.html"> AuthName "Member Only" AuthType Basic AuthUserFile /html/username/.htpasswd require valid-user </FilesMatch> php mettre dans un .htaccess: php_flag register_globals off mixed protection (password and IP adress - those doesn't have to provide a password) AuthUserFile /w3/.htpasswd AuthGroupFile /dev/null AuthName "Intranet" AuthType Basic Require valid-user Order deny,allow Deny from all Allow from 127.0.0.1 Satisfy Any Enregistrer une variable dans un .htaccess dans le .htaccess: SetEnv INDEX_URL http://example.com/index.php dans le php $indexUrl = getenv('INDEX_URL'); à utiliser à vos risques et périls… pas l'air trop orthodoxe ce truc! UTF-8 Si on veut écrire un fichier .htaccess en UTF-8, il faut que ce soit du UTF-8 sans le “byte order mark” (BOM) envoyé dans l'entête du fichier. Ainsi un fichier encodé UTF-8, no BOM fonctionnera. http://unicode.org/faq/utf_bom.html#BOM info/htaccess_.htpasswd_files.txt Dernière modification : 2021/06/29 10:22de radeff S'identifier