# HOTLINK PROTECTION
<ifModule mod_rewrite.c>
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} \.(gif|jpe?g?|png)$ [NC]
RewriteCond %{REQUEST_FILENAME} !/hotlink\-(01|02).gif$ [NC]
RewriteCond %{HTTP_REFERER} !^https?://([^.]+\.)?example\. [NC]
# RewriteRule \.(gif|jpe?g?|png)$ - [F,NC,L]
RewriteRule \.(gif|jpe?g?|png)$ http://example.com/wordpress/hotlink-02.gif [R,NC,L]
</ifModule>
# BLOCK EVIL REQUESTS
<ifModule mod_rewrite.c>
Options +FollowSymLinks
RewriteCond %{QUERY_STRING} (<|%3C).*script.*(>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|[|%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|[|%[0-9A-Z]{0,2})
RewriteRule .* blacklist.php [F,L]
</ifModule>
# BLOCK SCUM REFERRERS
<ifModule mod_rewrite.c>
RewriteCond %{HTTP_REFERER} (.*)secondchanceranch(.*) [NC]
RewriteRule .* - [F,L]
</ifModule>
# DENY ACCESS TO NO-REFERRER REQUESTS
<ifModule mod_rewrite.c>
RewriteCond %{REQUEST_METHOD} POST
RewriteCond %{REQUEST_URI} .wp-comments-post\.
RewriteCond %{HTTP_REFERER} !.*example\. [OR,NC]
RewriteCond %{HTTP_USER_AGENT} ^$
RewriteRule .* - [F,L]
</ifModule>
# REDIRECT URL (fafich.ufmg.br)
<ifModule mod_rewrite.c>
RewriteCond %{REQUEST_FILENAME} .*
RewriteCond %{HTTP_REFERER} ^https?://([^.]+\.)?ufmg\. [NC]
RewriteRule .* - [F,L]
</ifModule>
Miscellaneous snippets
# SUBSCRIPTION PLUGIN
<ifModule mod_rewrite.c>
RewriteBase /
RewriteCond %{QUERY_STRING} !wp\-subscription\-manager [NC]
RewriteCond %{REQUEST_URI} ^/press/$ [NC]
RewriteRule .* http://example.com/ [R=301,L]
</ifModule>
bash htaccess
<iframe width="100%" height="1100" src="https://snippet.echosystem.fr?embed=52ef70e5df166" type="text/html"></iframe>
Texte seul - Permalink - Snippet public posté le 03/02/2014
# CANONICAL ROBOTS.TXT
<ifModule mod_alias.c>
RedirectMatch 301 ^/(.*)/robots\.txt http://example.com/robots.txt
</ifModule>
# CANONICAL SITEMAP
<ifModule mod_alias.c>
RedirectMatch 301 /sitemap\.xml$ http://example.com/sitemap-press.xml
RedirectMatch 301 /sitemap\.xml\.gz$ http://example.com/sitemap-press.xml.gz
</ifModule>
# MULTIPLE SITEMAPS
<ifModule mod_rewrite.c>
RewriteBase /
RewriteCond %{REQUEST_URI} !^/sitemap\-(perish|press)\.xml(.gz)?$ [NC]
RewriteRule /sitemap\-(.*)?\.?(.*)?(.*)? http://example.com/sitemap-$1.$2$3 [R=301,L]
</ifModule>
# CANONICAL XMLRPC
<ifModule mod_alias.c>
RedirectMatch 301 /press/(.*)/xmlrpc\.php$ http://example.com/press/xmlrpc.php
</ifModule>
# FORCE TRAILING SLASH
<ifModule mod_rewrite.c>
RewriteCond %{REQUEST_URI} /+[^\.]+$
RewriteRule ^(.+[^/])$ %{REQUEST_URI}/ [R=301,L]
</ifModule>
# ROOT CANONICALIZATION
<ifModule mod_rewrite.c>
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php [NC]
RewriteRule ^index\.php$ http://example.com/ [R=301,L]
RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
RewriteRule (.*) http://example.com/$1 [R=301,L]
</ifModule>
# CANONICALIZATION
<ifModule mod_alias.c>
# REMOVE INTITIAL INDEX.PHP
RedirectMatch 301 index.php/(.*) http://example.com/press/$1
</ifModule>
<ifModule mod_rewrite.c>
# REMOVE ADDITIONAL INDEX.PHP
RewriteBase /press/
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.(html|php)\ HTTP/
RewriteRule ^(([^/]+/)*)index\.(html|php)$ http://example.com/press/$1 [R=301,L]
# FORCE TRAILING SLASH
RewriteCond %{REQUEST_URI} /+[^\.]+$
RewriteRule ^(.+[^/])$ %{REQUEST_URI}/ [R=301,L]
</ifModule>
# REDIRECT PAGE QUERIES
<ifModule mod_rewrite.c>
RewriteCond %{REQUEST_URI} !example.com [NC]
RewriteCond %{REQUEST_URI} !^/$ [NC]
RewriteCond %{QUERY_STRING} ^p\= [NC]
RewriteRule (.*) http://example.com/? [R=301,L]
</ifModule>
# REDIRECT SUBDIRECTORIES
<ifModule mod_rewrite.c>
RewriteBase /
RewriteCond %{REQUEST_URI} ^/(perish|press)/?$
RewriteRule .* http://example.com/ [R=301,L]
</ifModule>
# CLEAN EXTERNAL LINKS
<ifModule mod_rewrite.c>
RewriteBase /
RewriteCond %{QUERY_STRING} scamdex [NC]
RewriteRule .* http://example.com/$1? [R=301,L]
</ifModule>
bash htaccess
<iframe width="100%" height="1496" src="https://snippet.echosystem.fr?embed=52ef7058a59a1" type="text/html"></iframe>
Texte seul - Permalink - Snippet public posté le 03/02/2014
# DISABLE ETAGS
<filesMatch "\\.(ico|pdf|flv|jpe?g?|png|gif|js|css|swf|txt|mp3|avi|mpe?g?|wmv)$">
FileETag none
</filesMatch>
# FILE COMPRESSION
<ifModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</ifModule>
bash htaccess
<iframe width="100%" height="398" src="https://snippet.echosystem.fr?embed=52ef6ea978d77" type="text/html"></iframe>
Texte seul - Permalink - Snippet public posté le 03/02/2014