السلام عليكم
بعد نجاح الكود الاول
اليوم جايب لكم
نفس الكود في الموضوع السابقه
بالاضافه على كود تقليل الباندوث و ينزل اللود و كود حمايه
كود الحمايه هو عند محاولة الاختراق
راح يحصل نفس المخترق برا المنتدى
المثال
رمز Code:
RewriteEngine On<IfModule mod_gzip.c>mod_gzip_on YesYes mod_gzip_keep_wmod_gzip_dechun korkfiles Nonegotiate Yes mod_gzip_addmod_gzip_can __header_count YesYes mod_gzip_command_vmod_gzip_send_vary ersion '/mod_gzip_status'gzip_minimum_file_sizemod_gzip_min_http 1000 mod _ 300 mod_gzip_maximum_file_size 512000ip_handle_methods GET POST mod_gzmod_gzip_maximum_inmem_size 60000 mod_g zip_temp_dir /tmp mod_gzip_item_include file .html$de file .pl$ mod_gzip_item_inclumod_gzip_item_include file .php$ mod_gzip_item_incl ude file .rb$ mod_gzip_item_include file .py$ mod_gzip_item_include file .cgi$mod_gzip_item_include file .css$ mod_gzip_item_include file.js$mod_gzip_item_include mime ^application/javascript$mod_gzip_item_include mime ^application/x-javascript$mod_gzip_item_include mime ^text/.*ix-directory$ mod_gzip_item_include handler ^cgi-mod_gzip_item_include mime ^httpd/u nscript$ mod_gzip_item_include handler ^server-status$em_include handler ^application/x-httpd-phpmod_gzip_item_include handler ^server-info$ mod_gzip_i t mod_gzip_item_exclude mime ^image/.* </IfModule> # compress all text and html:To compress much of what leaves the server AddOutputFilterByAddOutputFilterByType DEFLATE text/html text/plain text/xml # Gzip –Type DEFLATE text/html text/plain text/xml text/css application/x-javascript text/x-javascript text/phpe DEFLATE text/html AddOutputFilterByType DE# compress text, html, javascript, css, xml: AddOutputFilterByType DEFLATE text/plain AddOutputFilterByTy pFLATE text/xml AddOutputFilterByType DEFLATE text/css AddOutputFilterByType DEFLATE application/xmlAddOutputFilterByType DEFLATE application/javascriAddOutputFilterByType DEFLATE application/xhtml+xml AddOutputFilterByType DEFLATE application/rss+xm lpt AddOutputFilterByType DEFLATE application/x-javascript # Start site protection # proc/self/environ? no way!URL RewriteCond %{QUERY_STRING} mosConfig_[a-zA-ZRewriteCond %{QUERY_STRING} proc/self/environ [OR] # Block out any script trying to set a mosConfig value through th e_]{1,21}(=|%3D) [OR] # Block out any script trying to base64_encode crap to send via URL RewriteCond %{QUERY_STRING} base64_encode.*(.*) [OR]trying to set a PHP GLOBALS variable via URL RewriteCond %# Block out any script that includes a <script> tag in URL RewriteCond %{QUERY_STRING} (<|%3C).*script.*(>|%3E) [NC,OR] # Block out any script {QUERY_STRING} GLOBALS(=|[|%[0-9A-Z]{0,2}) [OR] # Block out any script trying to modify a _REQUEST variable via URL RewriteCond %{QUERY_STRING} _REQUEST(=|[|%[0-9A-Z]{0,2})e bandwidth :: BEGIN <ifModule mod_php5.c> php_value zlib.output# Send all blocked request to homepage with 403 Forbidden error! RewriteRule ^(.*)$ index.php [F,L] # End site protection # www.n17n.com to enable compression and sa v_compression 16386 </ifModule>sion and save bandwidth :: END# www.n17n.com to enable compre s
غيرو n17n بدومينك
و هذي الاكواد مفصل
اول شي
ضغط الملفات و تسريع الموقع
رمز Code:
RewriteEngine On<IfModule mod_gzip.c>mod_gzip_on YesYes mod_gzip_keep_wmod_gzip_dechun korkfiles Nonegotiate Yes mod_gzip_addmod_gzip_can __header_count YesYes mod_gzip_command_vmod_gzip_send_vary ersion '/mod_gzip_status'gzip_minimum_file_sizemod_gzip_min_http 1000 mod _ 300 mod_gzip_maximum_file_size 512000ip_handle_methods GET POST mod_gzmod_gzip_maximum_inmem_size 60000 mod_g zip_temp_dir /tmp mod_gzip_item_include file .html$de file .pl$ mod_gzip_item_inclumod_gzip_item_include file .php$ mod_gzip_item_incl ude file .rb$ mod_gzip_item_include file .py$ mod_gzip_item_include file .cgi$mod_gzip_item_include file .css$ mod_gzip_item_include file.js$mod_gzip_item_include mime ^application/javascript$mod_gzip_item_include mime ^application/x-javascript$mod_gzip_item_include mime ^text/.*ix-directory$ mod_gzip_item_include handler ^cgi-mod_gzip_item_include mime ^httpd/u nscript$ mod_gzip_item_include handler ^server-status$em_include handler ^application/x-httpd-phpmod_gzip_item_include handler ^server-info$ mod_gzip_i t mod_gzip_item_exclude mime ^image/.* </IfModule> # compress all text and html:AddOutputFilterByType DEFLATE text/html text/plain text/xml
تقليل من الباندوث
رمز Code:
# Gzip – To compress much of what leaves the serverAddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript text/x-javascript text/php# compress text, html, javascript, css, xml: AddOutputFilterByType DEFLATE text/plaintFilterByType DEFLATE text/css AddOutpuAddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE text/xml AddOutp utFilterByType DEFLATE application/xml AddOutputFilterByType DEFLATE application/xhtml+xml/javascript AddOutputFilterByType DEFLATE applicaAddOutputFilterByType DEFLATE application/rss+xml AddOutputFilterByType DEFLATE applicatio ntion/x-javascript # Start site protection # proc/self/environ? no way! RewriteCond %{QUERY_STRING} proc/self/environ [OR]3D) [OR] # Block out any script trying to base64_encode crap to send v# Block out any script trying to set a mosConfig value through the URL RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=| %ia URL RewriteCond %{QUERY_STRING} base64_encode.*(.*) [OR] # Block out any script that includes a <script> tag in URL RewriteCond %{QUERY_STRING} (<|%3C).*script.*(>|%3E) [NC,OR]ariable via URL RewriteCond %{QUERY_STRING} _REQUEST(=|[|%[0-9A-Z]{# Block out any script trying to set a PHP GLOBALS variable via URL RewriteCond %{QUERY_STRING} GLOBALS(=|[|%[0-9A-Z]{0,2}) [OR] # Block out any script trying to modify a _REQUEST v0,2}) # Send all blocked request to homepage with 403 Forbidden error! RewriteRule ^(.*)$ index.php [F,L]# End site protection
حماية الموقع
رمز Code:
# www.n17n.com to enable compression and save bandwidth :: BEGIN<ifModule mod_php5.c> php_value zlib.output_compression 16386width :: EN</ifModule> # www.n17n.com to enable compression and save bandD
التركيب
ادخل على مسار
www
تضيف الكود داخل ملف .htaccess
الي يبي يحطها داخل مجلد المنتدى براحته
بس افضل وجودها في مسار الموقع
مهم
رمز Code:
RewriteEngine On
ما يكون مكرر اكثر من مره في ملف الهسست
عشان ما يسبب لك مشاكل في الاسيرفر
مره وحده يكفي
ارفقت لكم ملف جاهز فقط عدل الرابط
الاكواد مو من برمجتي
فقط من تجميعي
اخوكم
0 التعليقات:
إرسال تعليق