Skip to content

Instantly share code, notes, and snippets.

View olkitu's full-sized avatar

Minh Truong olkitu

View GitHub Profile
@olkitu
olkitu / functions.php
Created March 7, 2019 21:13
Hide WordPress version
<?php
remove_action('wp_head', 'wp_generator');
function wpbeginner_remove_version() {
return '';
}
add_filter('the_generator', 'wpbeginner_remove_version');
@olkitu
olkitu / .htaccess
Created March 7, 2019 21:12
Block access to PHP files on wp-content/upload, wp-content and wp-include directory
<Files ~ "\.ph(?:p[345]?|t|tml)$">
deny from all
</Files>
@olkitu
olkitu / .htaccess
Created March 7, 2019 21:11
Redirect WordPress site to HTTPS exclude Let's Encrypt Webroot directory
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# End WordPress
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !^/\.well\-known/acme\-challenge/
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
@olkitu
olkitu / nginx.conf
Created March 7, 2019 21:10
Block accessto WordPress directory and files
location = ~* /xmlrpc.php {
deny all;
access_log off;
log_not_found off;
}
location = ~* /wp-config.php {
deny all;
log_not_found off;
}
@olkitu
olkitu / .htaccess
Created March 7, 2019 21:09
Block access to Wordpress files and directory
Options -Indexes
<files xmlrpc.php>
order allow,deny
deny from all
</files>
<files wp-config.php>
order allow,deny
deny from all
</files>
<files ~ "^.*\.([Hh][Tt][Aa])">

Keybase proof

I hereby claim:

  • I am olkitu on github.
  • I am olkitu (https://keybase.io/olkitu) on keybase.
  • I have a public key ASAizXrvQIXsIiBAWmys3_Z5gNewZlz_E35a7epRfhB1dAo

To claim this, I am signing this object: