Skip to content

Instantly share code, notes, and snippets.

View surajbajracharya's full-sized avatar
😐
Love to learn

Suraj Bajracharya surajbajracharya

😐
Love to learn
View GitHub Profile
@surajbajracharya
surajbajracharya / htaccess example
Created July 30, 2019 15:33
Use WordPress .htaccess File to Secure Your Website for Users and Search Engines
Redirect 301 /oldpage.html http://www.yourwebsite.com/newpage.html
Redirect 301 /oldfolder/page2.html /folder3/page7.html
Redirect 301 / http://www.mynewwebsite.com/
@surajbajracharya
surajbajracharya / htaccess example
Created July 30, 2019 15:31
Use WordPress .htaccess File to Secure Your Website for Users and Search Engines
<Limit GET POST>
order allow,deny
deny from 123.456.78.9
allow from all
</Limit>
@surajbajracharya
surajbajracharya / htaccess example
Created July 30, 2019 15:29
Use WordPress .htaccess File to Secure Your Website for Users and Search Engines
# Limit logins and admin by IP
<Limit GET POST PUT>
order deny,allow
deny from all
allow from 12.34.56.78
</Limit>
@surajbajracharya
surajbajracharya / htaccess example
Created July 30, 2019 15:27
Use WordPress .htaccess File to Secure Your Website for Users and Search Engines
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^wp-admin/includes/ - [F,L]
RewriteRule !^wp-includes/ - [S=3]
RewriteRule ^wp-includes/[^/]+\.php$ - [F,L]
RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L]
RewriteRule ^wp-includes/theme-compat/ - [F,L]
</IfModule>
@surajbajracharya
surajbajracharya / htaccess example
Created July 30, 2019 15:24
Use WordPress .htaccess File to Secure Your Website for Users and Search Engines
Order deny,allow
Deny from all
<Files ~ ".(xml|css|jpe?g|png|gif|js)$">
Allow from all
</Files>
@surajbajracharya
surajbajracharya / htaccess example
Created July 30, 2019 15:22
Use WordPress .htaccess File to Secure Your Website for Users and Search Engines
<files wp-config.php>
order allow,deny
deny from all
</files>
@surajbajracharya
surajbajracharya / htaccess example
Last active July 30, 2019 15:19
Use WordPress .htaccess File to Secure Your Website for Users and Search Engines
<files ~ "^.*\.([Hh][Tt][Aa])">
order allow,deny
deny from all
satisfy all
</files>