المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : تسريع المنتدى + تقليل الباندوث + حماية المنتدى = htaccess


Ten
2011-12-11, 06:52 AM
السلام عليكم


بعد نجاح الكود الاول

ضغط الملفات و تسريع الموقع 100% (http://www.traidnt.net/vb/traidnt1894352/)

اليوم جايب لكم

نفس الكود في الموضوع السابقه

بالاضافه على كود تقليل الباندوث و ينزل اللود و كود حمايه

كود الحمايه هو عند محاولة الاختراق

راح يحصل نفس المخترق برا المنتدى


المثال






RewriteEngine On <IfModule mod_gzip.c>mod_gzip_on Yesmod_gzip_dechunk Yesmod_gzip_keep_workfiles Nomod_gzip_can_negotiate Yesmod_gzip_add_header_count Yesmod_gzip_send_vary Yesmod_gzip_command_version '/mod_gzip_status'mod_gzip_min_http 1000mod_gzip_minimum_file_size 300mod_gzip_maximum_file_size 512000mod_gzip_maximum_inmem_size 60000mod_gzip_handle_methods GET POSTmod_gzip_temp_dir /tmpmod_gzip_item_include file .html$mod_gzip_item_include file .php$mod_gzip_item_include file .pl$mod_gzip_item_include 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/.*mod_gzip_item_include mime ^httpd/unix-directory$mod_gzip_item_include handler ^cgi-script$mod_gzip_item_include handler ^server-status$mod_gzip_item_include handler ^server-info$mod_gzip_item_include handler ^application/x-httpd-phpmod_gzip_item_exclude mime ^image/.*</IfModule># compress all text and html:AddOutputFilterByType DEFLATE text/html text/plain text/xml # 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/plainAddOutputFilterByType DEFLATE text/htmlAddOutputFilterByType DEFLATE text/xmlAddOutputFilterByType DEFLATE text/cssAddOutputFilterByType DEFLATE application/xmlAddOutputFilterByType DEFLATE application/xhtml+xmlAddOutputFilterByType DEFLATE application/rss+xmlAddOutputFilterByType DEFLATE application/javascriptAddOutputFilterByType DEFLATE application/x-javascript# Start site protection# proc/self/environ? no way!RewriteCond %{QUERY_STRING} proc/self/environ [OR]# Block out any script trying to set a mosConfig value through the URLRewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|%3D) [OR]# Block out any script trying to base64_encode crap to send via URLRewriteCond %{QUERY_STRING} base64_encode.*(.*) [OR]# Block out any script that includes a <script> tag in URLRewriteCond %{QUERY_STRING} (<|%3C).*script.*(>|%3E) [NC,OR]# Block out any script trying to set a PHP GLOBALS variable via URLRewriteCond %{QUERY_STRING} GLOBALS(=|[|%[0-9A-Z]{0,2}) [OR]# Block out any script trying to modify a _REQUEST variable via URLRewriteCond %{QUERY_STRING} _REQUEST(=|[|%[0-9A-Z]{0,2})# 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 save bandwidth :: BEGIN<ifModule mod_php5.c>php_value zlib.output_compression 16386</ifModule># www.n17n.com to enable compression and save bandwidth :: ENDغيرو n17n بدومينك


و هذي الاكواد مفصل

اول شي

ضغط الملفات و تسريع الموقع


<IfModule mod_gzip.c>mod_gzip_on Yesmod_gzip_dechunk Yesmod_gzip_keep_workfiles Nomod_gzip_can_negotiate Yesmod_gzip_add_header_count Yesmod_gzip_send_vary Yesmod_gzip_command_version '/mod_gzip_status'mod_gzip_min_http 1000mod_gzip_minimum_file_size 300mod_gzip_maximum_file_size 512000mod_gzip_maximum_inmem_size 60000mod_gzip_handle_methods GET POSTmod_gzip_temp_dir /tmpmod_gzip_item_include file .html$mod_gzip_item_include file .php$mod_gzip_item_include file .pl$mod_gzip_item_include 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/.*mod_gzip_item_include mime ^httpd/unix-directory$mod_gzip_item_include handler ^cgi-script$mod_gzip_item_include handler ^server-status$mod_gzip_item_include handler ^server-info$mod_gzip_item_include handler ^application/x-httpd-phpmod_gzip_item_exclude mime ^image/.*</IfModule># compress all text and html:AddOutputFilterByType DEFLATE text/html text/plain text/xml</span>تقليل من الباندوث


# 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/plainAddOutputFilterByType DEFLATE text/htmlAddOutputFilterByType DEFLATE text/xmlAddOutputFilterByType DEFLATE text/cssAddOutputFilterByType DEFLATE application/xmlAddOutputFilterByType DEFLATE application/xhtml+xmlAddOutputFilterByType DEFLATE application/rss+xmlAddOutputFilterByType DEFLATE application/javascriptAddOutputFilterByType DEFLATE application/x-javascript# Start site protection# proc/self/environ? no way!RewriteCond %{QUERY_STRING} proc/self/environ [OR]# Block out any script trying to set a mosConfig value through the URLRewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|%3D) [OR]# Block out any script trying to base64_encode crap to send via URLRewriteCond %{QUERY_STRING} base64_encode.*(.*) [OR]# Block out any script that includes a <script> tag in URLRewriteCond %{QUERY_STRING} (<|%3C).*script.*(>|%3E) [NC,OR]# Block out any script trying to set a PHP GLOBALS variable via URLRewriteCond %{QUERY_STRING} GLOBALS(=|[|%[0-9A-Z]{0,2}) [OR]# Block out any script trying to modify a _REQUEST variable via URLRewriteCond %{QUERY_STRING} _REQUEST(=|[|%[0-9A-Z]{0,2})# 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 save bandwidth :: BEGIN<ifModule mod_php5.c>php_value zlib.output_compression 16386</ifModule># www.n17n.com to enable compression and save bandwidth :: ENDالتركيب

ادخل على مسار

www

تضيف الكود داخل ملف .htaccess

الي يبي يحطها داخل مجلد المنتدى براحته

بس افضل وجودها في مسار الموقع





ما يكون مكرر اكثر من مره في ملف الهسست

عشان ما يسبب لك مشاكل في الاسيرفر

مره وحده يكفي


ارفقت لكم ملف جاهز فقط عدل الرابط


الاكواد مو من برمجتي


فقط من تجميعي

اخوكم

باسم الشمراني