In this wordpress tutorial for beginners you will learn how to protected your wordpress website again sql injections through .htaccess file and increase your website security. It’s important to note again that this is not going to keep you 100% protected forever so don’t blindly use this code and think that’s it. You need to keep on top of your security monitoring all the time. This will however at least block some of the most common attempts / attacks at SQL injection. Insert this code into your roots .htaccess file.
*check pin comment in comment section and you will find code there also because in description angle brackets not allow
Protect Against SQL Injection
IfModule mod_rewrite.c // add angle brackets
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_METHOD} ^(HEAD|TRACE|DELETE|TRACK) [NC]
RewriteRule ^(.*)$ - [F,L]
RewriteCond %{QUERY_STRING} \.\.\/ [NC,OR]
RewriteCond %{QUERY_STRING} boot\.ini [NC,OR]
RewriteCond %{QUERY_STRING} tag\= [NC,OR]
RewriteCond %{QUERY_STRING} ftp\: [NC,OR]
RewriteCond %{QUERY_STRING} http\: [NC,OR]
RewriteCond %{QUERY_STRING} https\: [NC,OR]
RewriteCond %{QUERY_STRING} (\ #addanglebracket |%3C).*script.*(\ #addanglebracket |%3E) [NC,OR]
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|%3D) [NC,OR]
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [NC,OR]
RewriteCond %{QUERY_STRING} ^.*(\[|\]|\(|\)| #addanglebracket | #addanglebracket |ê|"|;|\?|\*|=$).* [NC,OR]
RewriteCond %{QUERY_STRING} ^.*(%24&x).* [NC,OR]
RewriteCond %{QUERY_STRING} ^.*(%0|%A|%B|%C|%D|%E|%F|127\.0).* [NC,OR]
RewriteCond %{QUERY_STRING} ^.*(globals|encode|localhost|loopback).* [NC,OR]
RewriteCond %{QUERY_STRING} ^.*(request|select|insert|union|declare).* [NC]
RewriteCond %{HTTP_COOKIE} !^.*WordPress_logged_in_.*$
RewriteRule ^(.*)$ - [F,L]
/IfModule // add angle brackets
#sqlinjection #htaccess #wordpress #webtaskwithhassan #hassangilani
Watch video How to Protect Against SQL Injection through htaccess file in WordPress online without registration, duration hours minute second in high quality. This video was added by user WebTask With Hassan 08 July 2022, don't forget to share it with your friends and acquaintances, it has been viewed on our site 944 once and liked it 19 people.