Skip to content

Instantly share code, notes, and snippets.

@sepehr
sepehr / .htaccess
Created August 16, 2012 15:22
Apache: .htaccess Template
##
# Apache .htaccess template
##
## Protect files and directories from prying eyes.
<FilesMatch "\.(make|test|md|po|sh|.*sql|.*bson|tpl(\.php)?|svn-base)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template|all-wcprops|entries|format)$">
Order allow,deny
</FilesMatch>
## Don't show directory listings for URLs which map to a directory.
<?php
function curl_setopt_custom_postfields($ch, $postfields, $headers = null) {
$algos = hash_algos();
$hashAlgo = null;
foreach ( array('sha1', 'md5') as $preferred ) {
if ( in_array($preferred, $algos) ) {
$hashAlgo = $preferred;
break;
}
}