חיפוש

אתר זה מקודם בגוגל בלי קישורים

htaccess עבור וורדפרס

.htaccess הוא קובץ תצורה המשמש את תוכנת שרת האינטרנט Apache. 

באתרי וורדפרס, קובץ ה-.htaccess משמש בדרך כלל כדי לשלוט על אופן הצגת כתובות האתרים וכדי להגדיר הפניות מחדש.

דרכים לדוגמה שבהן נעשה שימוש בקובץ .htaccess בוורדפרס:

קישורים קבועים יפים: 

ניתן להשתמש בקובץ .htaccess כדי להגדיר “קישורים קבועים יפים” לאתר הוורדפרס, שהם כתובות URL ידידותיות יותר למשתמש וידידותיות למנועי חיפוש עבור הפוסטים והדפים.

הפניות מחדש: 

ניתן להשתמש בקובץ .htaccess להגדרת הפניות מחדש, מה שיכול להיות שימושי כאשר אתה משנה את כתובת האתר של פוסט או דף, או כאשר אתה רוצה להפנות תנועה מאתר ישן לאתר חדש.

אבטחת האתר: 

ניתן להשתמש בקובץ .htaccess גם כדי ליישם אמצעי אבטחה, כגון חסימת תעבורה זדונית או מניעת גישה לספריות מסוימות.

כדי לשנות את קובץ ה-.htaccess באתר וורדפרס, ניתן להשתמש בתוסף כגון “WP Htaccess Editor” או “Simple Htaccess Editor”, או שאפשר וגם מומלץ למי שיכול לערוך את הקובץ באופן ידני באמצעות FTP או דרך cPanel של חשבון האירוח \ האחסון.

 חשוב להיזהר בעת שינוי קובץ ה-.htaccess, שכן טעות עלולה לשבור את האתר או למנוע ממנו לפעול כראוי.
פריצה שהייתה לאתר עורכי דין

סוגים על התקפת סייבר על וורדפרס

ישנם סוגים רבים ושונים של התקפות סייבר שיכולות למקד אתרי וורדפרס:


התקפות כוח brute force: 

התקפות אלו כוללות ניחוש אישורי הכניסה של משתמש על ידי ניסיון של מספר רב של שילובים עד שיימצא הנכון.

התקפות תוכנה זדונית malware וטרואיינים: 

תוכנה זדונית היא תוכנה זדונית שניתן להשתמש בה כדי לקבל גישה לא מורשית לאתר או לגניבת מידע רגיש. 

אתרי וורדפרס יכולים להיות ממוקדים על ידי התקפות תוכנות זדוניות באמצעים שונים, כמו פלאגינים או ערכות נושא נגועים, או על ידי ניצול נקודות תורפה בקוד האתר.

התקפות פישינג: 

התקפות אלו כוללות הטעיית משתמשים לחשוף את פרטי הכניסה או מידע רגיש אחר על ידי שליחת אימיילים מזויפים או אתרים שנראים לגיטימיים.

התקפות הזרקת SQL: 

התקפות אלו כרוכות בהחדרת קוד זדוני למסד הנתונים של האתר באמצעות פגיעות בקוד האתר, המאפשרת לתוקף לגשת לנתונים המאוחסנים במסד הנתונים או לתפעל אותם.

התקפות סקריפטים חוצי אתרים (XSS): 

התקפות אלו כרוכות בהחדרת קוד זדוני לאתר אינטרנט אשר מבוצע לאחר מכן על ידי הדפדפן של מבקר לא חושד, מה שמאפשר לתוקף לגנוב מידע רגיש או להשתלט על המחשב של המבקר.

כדי להגן על אתר הוורדפרס מפני התקפות סייבר, חשוב לשמור על התוכנה והתוספים מעודכנים, להשתמש בסיסמאות חזקות וייחודיות ולסרוק באופן קבוע את האתר לאיתור נקודות תורפה. 

ייתכן שתרצה לשקול שימוש בתוספים או בשירותי אבטחה כדי לסייע בשמירה על האתר.

הפנייה בטוחה מפרוטוקול לא מאובטח ללא תעודת אבטחה למאובטח עם SSL.

				
					#Redirect http to https
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
				
			

הגנה מפני בוטים וuser agent חשודים.

				
					#Block bad hackers
SetEnvIfNoCase User-Agent "^libwww-perl*" block_bad_bots
Deny from env=block_bad_bots
				
			

הגנה על ספריות מגישה בלתי מורשית ומניעת דלף מידע.

				
					# Disable directory browsing
Options All -Indexes
				
			

הגנה על קבצי הHTACCESS.

				
					# Deny access to all .htaccess files
<files ~ "^.*\.([Hh][Tt][Aa])">
order allow,deny
deny from all
satisfy all
</files>
 
# Deny access to readme.html
<files readme.html>
Order allow,deny
Deny from all
</files>
 
# Deny access to license.txt
<files license.txt>
Order allow,deny
Deny from all
</files>
 
# Deny access to wp-config.php file
<files wp-config.php>
order allow,deny
deny from all
</files>
 
# Deny access to error_log
<files error_log>
Order allow,deny
Deny from all
</files>
				
			

חסימת גישה לא מאושרת לספריות רגישות wp-includes

				
					# Deny access to wp-includes folder and files
<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>
				
			

הגנה מפני התקפות מסוג XSS.

				
					# Blocks some XSS attacks
<IfModule mod_rewrite.c>
RewriteCond %{QUERY_STRING} (\|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
RewriteRule .* index.php [F,L]
</IfModule>
				
			

הגנה על קבצי PHP של התבנית והתוספים.

				
					# Restricts access to PHP files from plugin and theme directories
RewriteCond %{REQUEST_URI} !^/wp-content/plugins/file/to/exclude\.php
RewriteCond %{REQUEST_URI} !^/wp-content/plugins/directory/to/exclude/
RewriteRule wp-content/plugins/(.*\.php)$ - [R=404,L]
RewriteCond %{REQUEST_URI} !^/wp-content/themes/file/to/exclude\.php
RewriteCond %{REQUEST_URI} !^/wp-content/themes/directory/to/exclude/
RewriteRule wp-content/themes/(.*\.php)$ - [R=404,L]
				
			

הגנה מפני הזרקות קוד בטכניקות SQLI

				
					# Protect Against SQL Injection
<IfModule mod_rewrite.c>
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} (\<|%3C).*script.*(\>|%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} ^.*(\[|\]|\(|\)|<|>|ê|"|;|\?|\*|=$).* [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>
				
			

חסימת הפעלת קבצים PHP בספריית wp-include.

				
					# Protect Against php execution
<Files *.php>
deny from all
</Files>
				
			

חסימת יישום בספריית העלאות wp-contet uploads.

				
					# Disable access to all file types except the following
#Order deny,allow
#Deny from all
#<Files ~ ".(xml|css|js|jpe?g|png|gif|pdf|docx|rtf|odf|zip|rar)$">
#Allow from all
#</Files>
				
			

קובץ htaccess הגדרות שלם מומלץ ברמה כללית לאתרי וורדפרס.

חסימת בוטים רעים, חסימת גישה לספריות רגישות ומניעת הזרקות קוד ממשפחת האיומים מסוג  sqli. 

				
					##############################
#.HTACCESS FILE INFO BY 
#THRIVEWP.COM
##############################

#BEGIN https code
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

#BEGIN Block bad hackers
SetEnvIfNoCase User-Agent "^libwww-perl*" block_bad_bots
Deny from env=block_bad_bots

# Disable directory browsing
Options All -Indexes

# Deny access to all .htaccess files
<files ~ "^.*\.([Hh][Tt][Aa])">
order allow,deny
deny from all
satisfy all
</files>
 
# Deny access to readme.html
<files readme.html>
Order allow,deny
Deny from all
</files>
 
# Deny access to license.txt
<files license.txt>
Order allow,deny
Deny from all
</files>
 
# Deny access to wp-config.php file
<files wp-config.php>
order allow,deny
deny from all
</files>
 
# Deny access to error_log
<files error_log>
Order allow,deny
Deny from all
</files>

# Deny access to wp-includes folder and files
<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>

# Blocks some XSS attacks
<IfModule mod_rewrite.c>
RewriteCond %{QUERY_STRING} (\|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
RewriteRule .* index.php [F,L]
</IfModule>

# Restricts access to PHP files from plugin and theme directories
RewriteCond %{REQUEST_URI} !^/wp-content/plugins/file/to/exclude\.php
RewriteCond %{REQUEST_URI} !^/wp-content/plugins/directory/to/exclude/
RewriteRule wp-content/plugins/(.*\.php)$ - [R=404,L]
RewriteCond %{REQUEST_URI} !^/wp-content/themes/file/to/exclude\.php
RewriteCond %{REQUEST_URI} !^/wp-content/themes/directory/to/exclude/
RewriteRule wp-content/themes/(.*\.php)$ - [R=404,L]

# Protect Against SQL Injection
<IfModule mod_rewrite.c>
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} (\<|%3C).*script.*(\>|%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} ^.*(\[|\]|\(|\)|<|>|ê|"|;|\?|\*|=$).* [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>
				
			
כותב המאמר
כותב המאמר
Picture of מייקל אנג'ל

מייקל אנג'ל

מקדם אתרים וחוקר סייבר יותר מידי שנים,
קיים קשר בין קידום אורגני לתופעות סייבר בשנים האחרונות ולא תמיד גוגל יודעת על מניפולציות שמשפיעות על תוצאות החיפוש שלה.
המיתוסים הקיימים בעולם הקידום האורגני ראוי שיתגלו ועמוד זה מכיל חלק ממיתוסים אלו
דף זה ימשיך להתעדכן אז כדאי לשמור ולעקוב אחריו

All Posts