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
# Disable direct access to xmlrpc.php to add some security to WordPress site | |
RewriteRule ^xmlrpc\.php$ - [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
# Disable direct access to *.php in /wp-includes folder to prevent Full Path Disclosure | |
RewriteRule ^wp-includes/[^/]+\.php$ - [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
# First redirect to https. Always before every other redirect according to https://internet.nl/test-site/ | |
if ($scheme = http) { | |
return 301 https://www.$server_name$request_uri; | |
} | |
# Non-www to www redirect | |
if ($host !~* ^www\.) { | |
rewrite ^(.*)$ https://www.$host$1 permanent; | |
} |
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 to functions.php | |
/** | |
* cache_proof_asset_url | |
* @param string $asset_file (relative, eg: /css/style.css) | |
* @return string $asset_file_url (absolute, eg: https://www.domain.com/css/style.css?v=123456789) | |
*/ | |
function cache_proof_asset_url($asset_file) { | |
$full_asset_url = bloginfo('stylesheet_directory') . $asset_file; |
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
/** | |
* Periodic reset all user password in a Google Apps (G Suite) group. | |
* Optional: skip users based on emailaddress | |
* | |
* -- You need Google Apps (G Suite) admin rights to run this script. -- | |
* -- Use Google Apps script triggers to force resets periodically. -- | |
* | |
* @author: Denver Sessink <https://twitter.com/webvakker> | |
*/ | |
function periodicPasswordReset() { |
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
# Force non-www to www redirect | |
if ($host !~* ^www\.) { | |
rewrite ^(.*)$ $scheme://www.$host$1 permanent; | |
} | |
# Turn on SSL | |
# protip: https://mozilla.github.io/server-side-tls/ssl-config-generator/ | |
ssl on; | |
add_header Strict-Transport-Security max-age=15768000; |
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
# NOTES | |
# SSL Key is privkey.pem | |
# SSL Request does not exist and is not needed (CSR) | |
# SSL Certificate is cert.pem | |
# SSL Bundle is chain.pem | |
# Stop Apache | |
service apache2 stop | |
# Create SSL Certificate |
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
error_page 404 /404.shtml; | |
if ($host !~* ^www\.) { | |
rewrite ^(.*)$ http://www.$host$1 permanent; | |
} | |
location ~* \.(jpg|jpeg|gif|css|ttf|woff|png|htc|gz|zip|swf|txt|flv|svg|ttf|atom|rss|svgz|cur|js|ico|html)$ { | |
access_log off; | |
expires 30d; | |
add_header Pragma public; |
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
# BEGIN GZIP | |
<IfModule mod_deflate.c> | |
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript text/javascript | |
</IfModule> | |
# END GZIP | |
# BEGIN Expires | |
<IfModule mod_expires.c> | |
ExpiresActive On | |
ExpiresDefault "access plus 1 seconds" |
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
<!doctype html> | |
<html class="no-js" lang=""> | |
<head> | |
<meta charset="utf-8"> | |
<title></title> | |
</head> | |
<body> | |
<!-- Add your site or application content here --> |
NewerOlder