Isu keamanan memang selalu ada dibanyak aspek termasuk salah satunya adalah wordpress, ternyata ada pengguna blogger yang diketahui webnya disusupi oleh pihak2 yang tidak bertanggungjawab. Untuk mengantisipasi hal tersebut berikut ada beberapa trik yang hanya menyisipkan beberapa baris perintah pada file .htaccess ….
Ga usah make lama, berikut baris perintah yang harus disisipkan pada file .htaccess …..
<files .htaccess> order allow,deny deny from all </files>
<files wp-config.php> order allow,deny deny from all </files>
Perintah diatas untuk melindungi file .htaccess sendiri dan file wp-config.php, berdasarkan himbauan mbah @Genthonx owner Webhostnix tambahkan file .htaccess pada root wp-admin dan tambahkan baris berikut supaya sedikit extreme 😀 :
<Files wp-admin.php> order allow,deny allow from 202.110.112.113 (ganti dengan ip Anda) deny from all </Files>
Sebagai tambahan dapat pula ditambahkan untuk mencegah spam comment dan hotlinking, secara keseluruhan perintah yang dimasukkan ke dalam file .htaccess seperti dibawah ini :
# Security hardening configuration # Disable the server signature ServerSignature Off # Protect the htaccess file <files .htaccess> order allow,deny deny from all </files> # Protect the wpconfig.php file <files wp-config.php> order allow,deny deny from all </files> # Protect from spam comments <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_METHOD} POST RewriteCond %{REQUEST_URI} .wp-comments-post.php* RewriteCond %{HTTP_REFERER} !.*xyz.* [OR] RewriteCond %{HTTP_USER_AGENT} ^$ RewriteRule (.*) ^http://%{REMOTE_ADDR}/$ [R=301,L] </IfModule> # Disable hotlinking of images with forbidden message <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://www.xyz.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://www.xyz.com$ [NC] RewriteCond %{HTTP_REFERER} !^http://xyz.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://xyz.com$ [NC] RewriteCond %{HTTP_REFERER} !google. [NC] RewriteCond %{HTTP_REFERER} !msn. [NC] RewriteCond %{HTTP_REFERER} !live. [NC] RewriteCond %{HTTP_REFERER} !yahoo. [NC] RewriteCond %{HTTP_REFERER} !gravatar. [NC] RewriteCond %{HTTP_REFERER} !search?q=cache [NC] RewriteRule .*.(jpg|jpeg|gif|png|bmp)$ - [F,NC] </IfModule>
Mudah2an topik pengamanan dengan .htaccess masih menjadi topik yang menarik untuk dibahas ….. mohon maaf kalo ada kurang2nya 😀 …..
sumber :Â www.allguru.net/web/wordpress-security-hardening-htaccess/
Related Search
Tags: #htaccess