Protect .svn directories using htaccess
// should be done server-wide if you can (another snippet)
<IfModule mod_rewrite.c> RewriteRule ^(.*/)?\.svn/ - [F,L] ErrorDocument 403 "Access Forbidden" IfModule>
2818 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)
<IfModule mod_rewrite.c> RewriteRule ^(.*/)?\.svn/ - [F,L] ErrorDocument 403 "Access Forbidden" IfModule>
<DirectoryMatch "^/.*/(\.svn|CVS)/"> Order deny,allow Deny from all DirectoryMatch>
# redirect all visitors to alternate site but retain full access for you ErrorDocument 403 http://www.alternate-site.com Order deny,allow Deny from all Allow from 99.88.77.66
RewriteEngine On RewriteCond %{HTTP_HOST} ^domain.com$ [NC] RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
<IfModule mod_rewrite.c> RewriteEngine On # 'under construction' override RewriteCond %{REMOTE_ADDR} !^127\.0\.0\.1$ RewriteRule ^(.*)$ maintenance.html IfModule>
RewriteEngine On RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteEngine On RewriteCond %{HTTP_HOST} ^www\.(.+)$ RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
RewriteEngine On RewriteCond %{HTTP_REFERER} ^http://(www\.)?evilwebsite\.com [NC,OR] RewriteCond %{HTTP_REFERER} ^http://forum\.evilwebsite\.com [NC,OR] RewriteCond %{HTTP_REFERER} ^http://(www\.)?bandwidththieves\.net [NC] RewriteRule \.(jpeg|jpg|gif|bmp|png|JPEG|JPG|GIF|BMP|PNG)$ http://example.com/pwnt.gif [L]
example.com/pwnt.gifis the location of the file you want to serve in place of the hotlinked image. Mine just says 'PWNT'.
RewriteRule \.(jpeg|jpg|gif|bmp|png|JPEG|JPG|GIF|BMP|PNG)$ - [F]
RewriteEngine on RewriteBase / RewriteCond %{HTTP_ACCEPT} application/xhtml\+xml RewriteCond %{HTTP_ACCEPT} !application/xhtml\+xml\s*;\s*q=0 RewriteCond %{REQUEST_URI} \.html$ RewriteCond %{THE_REQUEST} HTTP/1\.1 RewriteRule .* - [T=application/xhtml+xml]