Skip to content

Instantly share code, notes, and snippets.

@graphikuz
graphikuz / gist:10674e2ca1568db5003d
Created July 28, 2014 12:45
HTML: internet explorer version detection with css class in HTML tag
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
@graphikuz
graphikuz / gist:00266d257da9a85eace2
Last active August 29, 2015 14:04
Wordpress: Remove the version nunber of WP from header
/**
* Remove the version number of WP
*/
// Warning - this info is also available in the readme.html file in your root directory - delete this file!
remove_action('wp_head', 'wp_generator');
@graphikuz
graphikuz / gist:a2e9b85c01f5c4c0d824
Created July 28, 2014 15:05
Wordpress: Remove link rel "prev" and "next" from HEAD
/**
* Remove link rel "prev" and "next" from head
*/
remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );
@graphikuz
graphikuz / gist:0a081416c338417847c9
Created July 30, 2014 21:00
Htaccess: Protect wp-config.php
# Protect wp-config.php
<files wp-config.php>
Order deny,allow
Deny from all
</files>
@graphikuz
graphikuz / gist:632efc7e7fc299cb139d
Created July 30, 2014 21:01
Htaccess: Disable directory browsing
# Disable directory browsing
Options All -Indexes
@graphikuz
graphikuz / gist:ffe1ae00f95b1a237a52
Last active August 29, 2015 14:04
Htaccess: Strong htaccess protection
# Strong htaccess protection
<Files ~ "^.*\.([Hh][Tt][Aa])">
order allow,deny
deny from all
satisfy all
</Files>
@graphikuz
graphikuz / gist:ca83450e48a35e4d4b8e
Last active August 29, 2015 14:04
Htaccess: Prevent hotlinking
# Prevent hotlinking
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?website.com [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ - [NC,F,L]
@graphikuz
graphikuz / gist:30516117affe0656cf4d
Last active August 29, 2015 14:04
Htaccess: Protect from SQL injection
# Protect from sql injection
Options +FollowSymLinks
RewriteEngine On
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 ^(.*)$ index.php [F,L]
@graphikuz
graphikuz / gist:356b7133249783aee0ed
Created July 30, 2014 21:06
Htaccess: Error documents
# Error documents
ErrorDocument 403 /403.htm
ErrorDocument 404 /404.htm
@graphikuz
graphikuz / gist:28dbab656ad386d35476
Last active August 29, 2015 14:04
htaccess: Font MIME types
# Font mime types
#AddType application/vnd.ms-fontobject .eot
#AddType application/x-font-ttf .ttf
#AddType application/x-font-woff .woff
AddType font/ttf .ttf
AddType font/eot .eot
AddType font/otf .otf
AddType font/opentype .woff