رفتن به مطلب

بهترین تنظیماتی که برای فایل .htaccess میتوان اعمال کرد چیست؟


a556148306

پست های پیشنهاد شده

بهترین تنظیماتی که برای فایل .htaccess میتوان اعمال کرد چیست؟

چگونه و چه کد هایی برای تامین امنیت و کارایی وردپرس در این فایل میشود استفاده کرد تا سایت امن تری داشته باشیم؟

ممنون از متخصصانی که در این زمینه نظر می دهند

لینک به ارسال
<files ".htaccess">
	order allow,deny
	deny from all
</files>

# pass the default character set
AddDefaultCharset utf-8

ErrorDocument 401 /error/401.php
ErrorDocument 403 /error/403.php
ErrorDocument 404 /error/404.php
ErrorDocument 500 /error/500.php

#Options All

#Gzip
<ifmodule mod_deflate.c>
	AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</ifmodule>
#End Gzip

# BEGIN Expire headers
<ifModule mod_expires.c>
	ExpiresActive On
	ExpiresDefault "access plus 5 seconds"
	ExpiresByType image/x-icon "access plus 2592000 seconds"
	ExpiresByType image/jpeg "access plus 2592000 seconds"
	ExpiresByType image/png "access plus 2592000 seconds"
	ExpiresByType image/gif "access plus 2592000 seconds"
	ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
	ExpiresByType text/css "access plus 604800 seconds"
	ExpiresByType text/javascript "access plus 216000 seconds"
	ExpiresByType application/javascript "access plus 216000 seconds"
	ExpiresByType application/x-javascript "access plus 216000 seconds"
	ExpiresByType text/html "access plus 600 seconds"
	ExpiresByType application/xhtml+xml "access plus 600 seconds"
</ifModule>
# END Expire headers

# BEGIN Cache-Control Headers
<ifModule mod_headers.c>
	<filesMatch ".(ico|jpe?g|png|gif|swf)$">
		Header set Cache-Control "public"
	</filesMatch>
	<filesMatch ".(css)$">
		Header set Cache-Control "public"
	</filesMatch>
	<filesMatch ".(js)$">
		Header set Cache-Control "private"
	</filesMatch>
	<filesMatch ".(x?html?|php)$">
		Header set Cache-Control "private, must-revalidate"
	</filesMatch>
</ifModule>
# END Cache-Control Headers

# Block the include-only files.
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]

 

لینک به ارسال
در 17 ساعت قبل، b.soshiant گفته است :

<files ".htaccess">
	order allow,deny
	deny from all
</files>

# pass the default character set
AddDefaultCharset utf-8

ErrorDocument 401 /error/401.php
ErrorDocument 403 /error/403.php
ErrorDocument 404 /error/404.php
ErrorDocument 500 /error/500.php

#Options All

#Gzip
<ifmodule mod_deflate.c>
	AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</ifmodule>
#End Gzip

# BEGIN Expire headers
<ifModule mod_expires.c>
	ExpiresActive On
	ExpiresDefault "access plus 5 seconds"
	ExpiresByType image/x-icon "access plus 2592000 seconds"
	ExpiresByType image/jpeg "access plus 2592000 seconds"
	ExpiresByType image/png "access plus 2592000 seconds"
	ExpiresByType image/gif "access plus 2592000 seconds"
	ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
	ExpiresByType text/css "access plus 604800 seconds"
	ExpiresByType text/javascript "access plus 216000 seconds"
	ExpiresByType application/javascript "access plus 216000 seconds"
	ExpiresByType application/x-javascript "access plus 216000 seconds"
	ExpiresByType text/html "access plus 600 seconds"
	ExpiresByType application/xhtml+xml "access plus 600 seconds"
</ifModule>
# END Expire headers

# BEGIN Cache-Control Headers
<ifModule mod_headers.c>
	<filesMatch ".(ico|jpe?g|png|gif|swf)$">
		Header set Cache-Control "public"
	</filesMatch>
	<filesMatch ".(css)$">
		Header set Cache-Control "public"
	</filesMatch>
	<filesMatch ".(js)$">
		Header set Cache-Control "private"
	</filesMatch>
	<filesMatch ".(x?html?|php)$">
		Header set Cache-Control "private, must-revalidate"
	</filesMatch>
</ifModule>
# END Cache-Control Headers

# Block the include-only files.
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]

 

سلام کاش توضیحات کد ها رو هم میزاشتید که کاربران بیخودی هر چیزی رو کپی نکنن و فقط اونهایی که لازم هست رو کپی کنند

لینک به ارسال

 درود

کدهای مرسوم محافت از هسته سایت و محافظت از خود فایل htaccess و کدهای gzip (فشرده سازی) و کش هستند که وجودشون نیازه برای هر سایتی

لینک به ارسال
  • 8 ماه بعد...

به گفتگو بپیوندید

هم اکنون می توانید مطلب خود را ارسال نمایید و بعداً ثبت نام کنید. اگر حساب کاربری دارید، برای ارسال با حساب کاربری خود اکنون وارد شوید .

مهمان
ارسال پاسخ به این موضوع ...

×   شما در حال چسباندن محتوایی با قالب بندی هستید.   حذف قالب بندی

  تنها استفاده از 75 اموجی مجاز می باشد.

×   لینک شما به صورت اتوماتیک جای گذاری شد.   نمایش به صورت لینک

×   محتوای قبلی شما بازگردانی شد.   پاک کردن محتوای ویرایشگر

×   شما مستقیما نمی توانید تصویر خود را قرار دهید. یا آن را اینجا بارگذاری کنید یا از یک URL قرار دهید.

×
×
  • اضافه کردن...