This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteBase / | |
# Copy HTTP Authorization header value to HTTP_AUTOHRIZATION server variable for use by script | |
RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] | |
# On live server, rewrite requests for URL-paths which do not resolve to specific | |
# physically-existing filetypes to my script, excluding the script's URL-path itself. | |
RewriteCond %{HTTP_HOST} !^localhost$ | |
RewriteCond $1 !^index\.php | |
RewriteCond %{REQUEST_FILENAME} !-f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'wpcf7_form_class_attr', 'custom_custom_form_class_attr' ); | |
function custom_custom_form_class_attr( $class ) { | |
$class .= ' nice'; | |
return $class; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Inside the root directory of the Joomla 3 instance, run these commands to add .htaccess files | |
# to joomla directories (except ./administrator) that prevent direct access to them. | |
# Also see https://www.joomla-security.de/dateien-verzeichnisse/htaccess-einstellungen.html | |
# Generally block access from outside | |
echo "<Files "*.*"> | |
Deny from all | |
</Files>" > ./bin/.htaccess; cp -i ./bin/.htaccess ./cache/.htaccess; cp -i ./bin/.htaccess ./cli/.htaccess; cp -i ./bin/.htaccess ./includes/.htaccess; cp -i ./bin/.htaccess ./language/.htaccess; cp -i ./bin/.htaccess ./layouts/.htaccess; cp -i ./bin/.htaccess ./libraries/.htaccess; cp -i ./bin/.htaccess ./logs/.htaccess; cp -i ./bin/.htaccess ./tmp/.htaccess | |
# Block all except media files: First, create .htaccess file with |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# When changing joomla routing to not output article ids, google must be told where those articles are. | |
# Beware! This breaks if an article slug contains a number! | |
# https://docs.joomla.org/J3.x:New_Routing_System | |
RewriteRule category\/([a-z]*)\/(\d+)-([^/]*) https://www.site.example/category/$1/$3 [R=301,L] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Template Name: Kontakt | |
*/ | |
?> | |
<?php /* other template code goes here... */ ?> | |
<?php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Redirect Query String to Html file. | |
<IfModule mod_rewrite.c> | |
RewriteCond %{QUERY_STRING} ([a-z0-9]+) [NC] | |
RewriteRule (.*) /%1.html? [R=301,L] | |
</IfModule> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;to be placed in ROOT/language/overrides/ | |
JLIB_HTML_START="<i class=\"fa fa-fast-backward\"></i>" | |
JPREV="<i class=\"fa fa-backward\"></i>" | |
JNEXT="<i class=\"fa fa-forward\"></i>" | |
JLIB_HTML_END="<i class=\"fa fa-fast-forward\"></i>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# node version manager: list available versions | |
nvm ls | |
# nvm: see https://github.com/creationix/nvm | |
# node: get active version | |
node -v | |
# activate node version via nvm | |
nvm use 8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function hs_mailreplace($str) { | |
return preg_replace_callback ('^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})^', | |
create_function ( | |
'$str', | |
'for ($i = 0; $i < strlen($str[0]); $i++) { | |
$result .= "&#" . ord(substr($str[0], $i, 1)) . ";"; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// remove wp generator | |
// https://css-tricks.com/snippets/wordpress/remove-wp-generator-meta-tag/ | |
remove_action('wp_head', 'wp_generator'); | |
// disable emojis | |
// http://wordpress.stackexchange.com/questions/185577/disable-emojicons-introduced-with-wp-4-2 | |
function wpt_disable_emojis() { | |
remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); |
NewerOlder