Store
Community Documentation

v3 Knowledgebase

Me and my PhpFox site

Firstly, I want to say thank you to data66.

I make this, just to share my short story in what am I doing on PhpFox V3.3.0. on share hosting. Most all of this is about PhpFox improvement. And in this tutorial I am trying to collect what I did for it. Of course this is not about everything I do. Because I'm sure, you've got your own way.

1. Me and .htaccess file.
Of course first of all I concentrated with htacess file. It gives me comfort, because a lot of things to do in this file. Although I know that some are not suitable for your server. Some of its contents are as follows:

# URL Rewrite
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www.mysite.com$ [NC]
RewriteRule .* http://www.mysite.com%{REQUEST_URI} [R=301,L]

# Rename Photo Names
# RewriteRule ^file/pic/photo/([0-9]+)/([0-9]+)/([A-Za-z0-9]{32}+)-(.*?)([_0-9]*?).(.*)$ file/pic/photo/$1/$2/$3$5.$6

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php?do=/$1

# Image Access Protection
# RewriteRule ^file/pic/photo/(.*).(.*)$ static/image.php?file=$1&ext=$2
</IfModule>

# BEGIN GZIP
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE  text/html text/css text/plain image/svg+xml text/javascript text/xml application/x-javascript text/js image/jpg application/x-httpd-php application/xhtml+xml application/rss+xml application/javascript application/x-httpd-fastphp application/json
<IfModule mod_setenvif.c>
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch bMSIE !no-gzip !gzip-only-text/html
</IfModule>
<IfModule mod_headers.c>
Header append Vary User-Agent env=!dont-vary
</IfModule>
</ifmodule>
# END GZIPAddHandler mode-deflate mod_deflate


SetEnvIfNoCase User-Agent "^Baiduspider" UnwantedRobot
SetEnvIfNoCase User-Agent "^Yandex" UnwantedRobot
SetEnvIfNoCase User-Agent "^Exabot" UnwantedRobot
SetEnvIfNoCase User-Agent "^Cityreview" UnwantedRobot
SetEnvIfNoCase User-Agent "^Dotbot" UnwantedRobot
SetEnvIfNoCase User-Agent "^Sogou" UnwantedRobot
SetEnvIfNoCase User-Agent "^Sosospider" UnwantedRobot
SetEnvIfNoCase User-Agent "^Twiceler" UnwantedRobot


<FilesMatch ".(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header set Expires "Wed, 15 Apr 2020 20:00:00 GMT"
Header set Cache-Control "public"
</FilesMatch>

<FilesMatch ".(avi|flv|mov|wmv|wma|mp3|mp4|m4a|mkv|swf|pdf|doc|ppt|ico|jpg|jpeg|png|gif|js|css)$">
  <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresDefault A29030400
  </IfModule>
</FilesMatch>

# BEGIN Cache-Control Headers
<IfModule mod_headers.c>
<FilesMatch ".(bmp|css|flv|gif|ico|jpg|jpeg|js|pdf|png|svg|swf|tif|tiff|php)$">
Header set Last-Modified "Mon, 31 Aug 2009 00:00:00 GMT"
</FilesMatch>
</IfModule>
# END Cache-Control Headers

Header unset Pragma
FileETag None
Header unset ETag


<FilesMatch ".(js|css|jpg|png|jpeg|gif)$">
RequestHeader unset Cookie
Header unset Set-Cookie
Header unset ETag
FileETag None
</FilesMatch>

# Disable the server signature
ServerSignature Off

# Disable Libwww-perl Access
SetEnvIfNoCase User-Agent "^libwww-perl*" block_bad_bots
Deny from env=block_bad_bots

AddHandler application/x-httpd-php .css

# Pass the default character set
AddDefaultCharset utf-8

# Set the server administrator email
SetEnv SERVER_ADMIN admin@mysite.com

# PROTECT FILES
<FilesMatch ".(htaccess|htpasswd|ini|phps|fla|psd|log|sh)$">
Order Allow,Deny
Deny from all
</FilesMatch>


#PREVENT HACKs
# Block out any script trying to base64_encode crap to send via 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]
# 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 variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|[|%[0-9A-Z]{0,2})
RewriteRule ^(.*)$ /index.php [F,L]

# Deny access to evil robots site rippers offline browsers and other nasty scum
RewriteCond %{HTTP_USER_AGENT} ^Anarchie [OR]
RewriteCond %{HTTP_USER_AGENT} ^ASPSeek [OR]
RewriteCond %{HTTP_USER_AGENT} ^attach [OR]
RewriteCond %{HTTP_USER_AGENT} ^autoemailspider [OR]
RewriteCond %{HTTP_USER_AGENT} ^Xaldon WebSpider [OR]
RewriteCond %{HTTP_USER_AGENT} ^Xenu [OR]
RewriteCond %{HTTP_USER_AGENT} ^Zeus.*Webster [OR]
RewriteCond %{HTTP_USER_AGENT} ^Zeus
RewriteRule ^.* - [F,L]

# Blocking based on User-Agent Header
RewriteCond %{HTTP_USER_AGENT} ^.*(craftbot|download|extract|stripper|sucker|ninja|clshttp|webspider|leacher|collector|grabber|webpictures).*$ [NC]
RewriteRule . - [F,L]

# Denies obvious trackback spam
RewriteCond %{REQUEST_METHOD} =POST
RewriteCond %{HTTP_USER_AGENT} ^.*(opera|mozilla|firefox|msie|safari).*$ [NC]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9} /.+/trackback/? HTTP/ [NC]
RewriteRule .* - [F,NS,L]
# Google Analytics Integration - Added by cPanel.
<IfModule mod_substitute.c>
AddOutputFilterByType SUBSTITUTE text/html
Substitute "s|(<script src='/google_analytics_auto.js'></script>)?</head>|<script src='/google_analytics_auto.js'></script></head>|i"
</IfModule>
# END Google Analytics Integration

<Files *>
order deny,allow

# Cambodia (KH)
deny from 114.134.184.0/21

# Chinese (CN) IP addresses follow:
deny from 1.202.0.0/15 14.144.0.0/12 14.208.0.0/12 27.8.0.0/13 27.16.0.0/12 27.36.0.0/14 27.40.0.0/13 27.54.192.0/18 27.106.128.0/18 27.115.0.0/17 27.152.0.0/13 27.184.0.0/13 58.16.0.0/15 58.20.0.0/16 58.21.0.0/16 58.22.0.0/15 58.34.0.0/16 58.37.0.0/16 58.38.0.0/16 58.40.0.0/16 58.42.0.0/16 58.44.0.0/14 58.56.0.0/15 58.58.0.0/16 58.59.0.0/17 58.60.0.0/14 58.68.128.0/17 58.82.0.0/15 58.100.0.0/15 58.208.0.0/12 58.242.0.0/15 58.246.0.0/15 58.248.0.0/13 59.32.0.0/13 59.40.0.0/15 59.42.0.0/16 59.44.0.0/14 59.51.0.0/16 59.52.0.0/14 59.56.0.0/13 59.72.0.0/16 59.108.0.0/15 59.174.0.0/15 60.0.0.0/13 60.11.0.0/16 60.12.0.0/16 60.24.0.0/13 60.160.0.0/11 60.194.0.0/15 60.208.0.0/13 60.216.0.0/15 60.220.0.0/14 61.4.64.0/20 61.4.80.0/22 61.4.176.0/20 61.48.0.0/13 61.128.0.0/10 61.135.0.0/16 61.136.0.0/18 61.139.128.0/18 61.145.73.208/28 61.147.0.0/16 61.152.0.0/16 61.160.0.0/16 61.162.0.0/15 61.164.0.0/16 61.175.0.0/16 61.177.0.0/16 61.179.0.0/16 61.183.0.0/16 61.184.0.0/16 61.185.219.232/29 61.187.0.0/16 61.188.0.0/16 61.191.0.0/16 61.232.0.0/14 61.236.0.0/15 110.6.0.0/15 110.51.0.0/16 110.52.0.0/15 110.80.0.0/13 110.96.0.0/11 110.192.0.0/11 110.240.0.0/12 111.0.0.0/10 111.72.0.0/13 111.176.0.0/13 112.0.0.0/10 112.64.0.0/14 112.111.0.0/16 112.224.0.0/11 113.0.0.0/13 113.8.0.0/15 113.16.0.0/15 113.62.0.0/15 113.64.0.0/10 113.128.0.0/15 113.204.0.0/14 114.28.0.0/16 114.80.0.0/12 114.104.0.0/14 114.112.0.0/14 114.216.0.0/13 114.224.0.0/11 115.24.0.0/15 115.32.0.0/14 115.48.0.0/12 115.84.0.0/18 115.100.0.0/15 115.168.0.0/14 115.239.228.0/22 116.1.0.0/16 116.2.0.0/15 116.4.0.0/14 116.8.0.0/14 116.16.0.0/12 116.52.0.0/14 116.76.0.0/15 116.90.80.0/20 116.128.0.0/10 116.204.0.0/15 116.208.0.0/14 116.254.128.0/18 117.21.0.0/16 117.22.0.0/15 117.24.0.0/13 117.32.0.0/13 117.40.0.0/14 117.44.0.0/15 117.79.224.0/20 117.80.0.0/12 118.72.0.0/13 118.112.0.0/13 118.120.0.0/14 118.132.0.0/14 118.144.0.0/14 118.180.0.0/14 118.186.0.0/15 118.192.0.0/16 118.248.0.0/13 119.0.0.0/13 119.8.0.0/15 119.10.0.0/17 119.18.192.0/20 119.57.0.0/16 119.60.0.0/16 119.88.0.0/14 119.112.0.0/13 119.120.0.0/13 119.128.0.0/12 119.144.0.0/14 119.164.0.0/14 119.176.0.0/12 120.0.0.0/12 120.32.0.0/13 120.40.0.0/14 120.68.0.0/14 120.192.0.0/10 121.0.16.0/20 121.8.0.0/13 121.16.0.0/12 121.32.0.0/14 121.60.0.0/14 121.76.0.0/15 121.204.0.0/14 121.224.0.0/12 122.51.128.0/17 122.64.0.0/11 122.136.0.0/13 122.156.0.0/14 122.188.0.0/14 122.192.0.0/14 122.198.0.0/16 122.200.64.0/18 122.224.0.0/12 123.4.0.0/14 123.8.0.0/13 123.52.0.0/14 123.64.0.0/11 123.97.128.0/17 123.100.0.0/19 123.112.0.0/12 123.128.0.0/13 123.152.0.0/13 123.164.0.0/14 123.184.0.0/14 123.196.0.0/15 123.232.0.0/14 124.42.64.0/18 124.64.0.0/15 124.114.0.0/15 124.126.0.0/15 124.128.0.0/13 124.163.0.0/16 124.192.0.0/15 124.200.0.0/13 124.236.0.0/14 124.248.0.0/17 125.40.0.0/13 125.64.0.0/12 125.80.0.0/13 125.88.0.0/13 125.115.0.0/16 125.119.0.0/16 159.226.0.0/16 180.76.0.0/16 180.96.0.0/11 180.152.0.0/13 180.208.0.0/15 182.112.0.0/12 183.0.0.0/10 221.204.0.0/15 202.43.144.0/22 202.46.32.0/19 202.66.0.0/16 202.96.0.0/12 202.111.160.0/19 202.112.0.0/14 202.117.0.0/16 202.165.176.0/20 203.69.0.0/16 203.86.0.0/18 203.86.64.0/19 203.93.0.0/16 203.169.160.0/19 210.5.0.0/19 210.14.128.0/19 210.21.0.0/16 210.32.0.0/14 210.51.0.0/16 210.52.0.0/15 210.192.96.0/19 211.76.96.0/20 211.78.208.0/20 211.86.144.0/20 211.90.0.0/15 211.92.0.0/14 211.96.0.0/13 211.136.0.0/13 211.144.12.0/22 211.144.96.0/19 211.144.160.0/20 211.147.208.0/20 211.147.224.0/23 211.152.14.0/24 211.154.128.0/19 211.155.24.0/22 211.157.32.0/19 211.160.0.0/13 211.233.70.0/24 218.0.0.0/11 218.56.0.0/13 218.64.0.0/11 218.88.0.0/13 218.96.0.0/14 218.102.0.0/16 218.104.0.0/14 218.194.80.0/20 218.200.0.0/13 218.240.0.0/13 219.128.0.0/11 219.223.192.0/18 219.232.0.0/16 219.234.80.0/20 219.154.0.0/15 220.112.0.0/16 220.154.0.0/15 220.160.0.0/11 220.181.0.0/16 220.192.0.0/12 220.228.70.0/24 220.248.0.0/14 220.250.0.0/19 220.252.0.0/16 221.0.0.0/12 221.122.0.0/15 221.176.0.0/13 221.192.0.0/14 221.200.0.0/14 221.204.0.0/15 221.206.0.0/16 221.207.0.0/16 221.208.0.0/12 221.212.0.0/16 221.214.0.0/15 221.216.0.0/13 221.224.0.0/13 221.228.0.0/14 221.238.0.0/15 222.32.0.0/11 222.64.0.0/12 222.80.0.0/12 222.132.0.0/14 222.136.0.0/13 222.168.0.0/13 222.172.222.0/24 222.176.0.0/13 222.184.0.0/13 222.241.0.0/19 222.245.0.0/16 117.69.128.62 117.69.163.236 

# Hong Kong (HK)
deny from 58.65.232.0/21 59.148.0.0/15 112.121.160.0/19 113.252.0.0/14 121.127.224.0/19 123.242.229.0/24 180.235.134.0/24 202.69.64.0/19 202.85.128.0/19 202.133.8.0/21 203.218.0.0/16 210.176.0.0/19 210.176.48.0/20 210.176.64.0/18 210.176.128.0/17 210.177.0.0/16 218.103.0.0/16 218.252.0.0/14 219.76.0.0/14 222.166.0.0/16 223.16.0.0/14

# India (IN), Bangladesh (BD) and Pakistan (PK)
deny from 14.96.0.0/14 14.195.128.0/18 27.255.0.0/18 27.255.128.0/24 39.32.0.0/11 49.15.0.0/18 49.200.0.0/14 59.88.0.0/13 59.96.0.0/14 59.160.0.0/14 59.164.0.0/15 9.176.0.0/13 59.184.0.0/15 61.247.238.0/24 101.56.0.0/13 112.110.40.0/21 114.31.224.0/20 115.108.0.0/14 115.167.24.0/24 115.240.0.0/12 116.72.0.0/14 116.203.32.0/19 117.192.0.0/10 119.152.0.0/13 119.160.0.0/17 120.56.0.0/13 120.138.98.0/24 121.240.0.0/13 122.160.0.0/12 122.176.0.0/13 122.184.0.0/14 123.236.0.0/14 124.124.0.0/15 124.247.235.0/24 125.209.64.0/18 139.190.0.0/16 182.64.0.0/12 182.176.0.0/12 183.82.0.0/15 193.53.87.0/24 202.54.0.0/16 202.63.160.0/19 202.87.240.0/20 202.137.232.0/21 202.154.224.0/24 203.76.176.0/20 203.92.47.0/24 203.115.80.0/20 203.188.247.0/24 203.192.231.0/24 203.197.0.0/16 206.214.208.0/20 210.212.64.0/20 218.248.0.0/20

# Japan (JP) (hacking, scraping, or spamming)
deny from 27.50.96.0/19 42.83.0.0/18 58.188.0.0/14 59.146.0.0/15 61.112.0.0/12 118.0.0.0/12 118.86.0.0/15 118.106.0.0/16 122.200.192.0/18 122.208.0.0/12 123.216.0.0/13 124.84.0.0/14 126.0.0.0/8 150.70.84.41 210.248.0.0/13 211.19.0.0/16 218.216.0.0/13 218.224.0.0/13 219.94.128.0/17 219.96.0.0/11 220.104.0.0/13 220.208.0.0/12 221.121.160.0/20 222.231.64.0/18 222.231.128.0/17 222.144.0.0/13 223.216.0.0/14

# Korea (KR) IP addresses follow:
deny from 27.115.128.0/17 27.255.64.0/18 58.72.0.0/13 58.120.0.0/13 58.140.0.0/14 58.148.0.0/14 58.180.40.0/21 58.224.0.0/12 59.0.0.0/11 59.86.192.0/18 59.186.0.0/15 61.32.0.0/13 61.72.0.0/13 61.80.0.0/15 61.96.0.0/12 61.110.16.0/20 61.248.0.0/13 110.8.0.0/13 110.45.0.0/16 112.144.0.0/12 112.160.0.0/11 112.216.0.0/13 113.30.64.0/18 114.29.0.0/17 114.108.128.0/18 114.200.0.0/13 115.0.0.0/12 115.16.0.0/13 115.40.0.0/15 115.68.0.0/16 115.88.0.0/13 116.40.0.0/16 116.45.176.0/20 116.93.192.0/19 116.120.0.0/13 117.110.0.0/15 118.32.0.0/11 118.128.0.0/14 118.216.0.0/13 119.64.0.0/13 119.192.0.0/11 120.50.64.0/18 121.88.0.0/16 121.101.224.0/19 121.127.64.0/18 121.127.128.0/18 121.128.0.0/10 121.254.0.0/16 122.44.112.0/20 122.99.128.0/17 123.111.0.0/16 123.140.0.0/14 123.212.0.0/14 123.248.0.0/16 124.0.0.0/15 124.50.87.161 124.136.0.0/14 125.128.0.0/11 125.176.0.0/12 125.240.0.0/13 125.248.0.0/14 143.248.0.0/16 166.104.0.0/16 168.188.0.0/16 175.112.0.0/12 180.64.0.0/13 180.224.0.0/13 202.30.0.0/15 202.133.16.0/20 202.179.176.0/21 203.226.0.0/15 203.228.0.0/14 203.244.0.0/14 203.248.0.0/13 210.93.0.0/16 210.94.0.0/15 210.108.0.0/14 210.112.0.0/14 210.117.128.0/18 210.118.216.192/26 210.124.0.0/14 210.178.0.0/15 210.180.0.0/15 210.204.0.0/15 210.210.192.0/18 210.219.0.0/16 210.220.0.0/14 211.32.0.0/12 211.48.0.0/15 211.50.0.0/15 211.52.0.0/16 211.62.35.0/24 211.104.0.0/13 211.112.0.0/13 211.168.0.0/13 211.176.0.0/12 211.192.0.0/12 211.208.0.0/14 211.216.0.0/13 211.224.0.0/13 211.232.0.0/13 211.240.0.0/12 218.36.0.0/14 218.48.0.0/13 218.144.0.0/12 218.209.0.0/16 218.232.0.0/14 218.236.0.0/14 219.240.0.0/15 219.248.0.0/13 219.250.88.0/21 220.72.0.0/13 220.80.0.0/13 220.95.88.0/24 220.118.0.0/16 220.119.0.0/16 221.128.0.0/12 221.144.0.0/12 221.160.0.0/13 221.168.0.0/16 221.163.46.0/24 222.96.0.0/12 222.112.0.0/13 222.120.0.0/15 222.122.0.0/16 222.231.0.0/18 222.232.0.0/13

# Yahoo-Korea (provides free email services used by some spammers)
deny from 123.0.0.0/20

# Neighboring Asian countries:

# Malaysia (MY)
deny from 27.131.32.0/24 60.48.0.0/14 60.52.0.0/15 60.54.0.0/16 110.159.0.0/16 112.137.160.0/20 113.23.128.0/17 115.132.0.0/14 116.197.0.0/17 116.206.0.0/16 118.100.0.0/15 119.110.96.0/20 120.50.48.0/20 120.140.0.0/15 124.82.0.0/16 124.217.224.0/19 161.139.0.0/16 175.136.0.0/13 180.72.0.0/14 202.58.80.0/20 202.71.96.0/20 202.75.32.0/19 202.190.0.0/16 203.106.0.0/16 203.217.176.0/22 203.223.128.0/19 210.187.49.0/25 218.111.0.0/16 218.208.12.64/27

# Philippines (PH)
deny from 85.92.152.0/21 110.5.64.0/21 111.235.80.0/20 112.201.128.0/17 112.202.0.0/16 120.28.64.0/18 122.54.125.73 125.60.128.0/17 125.212.56.0/22 180.193.64.0/19 202.52.54.0/23 202.133.192.0/24 202.146.184.0/23 222.127.32.0/19 222.127.64.0/19

# Singapore (SG)
deny from 58.185.18.0/28 59.189.0.0/16 116.12.48.0/21 116.14.0.0/15 116.251.223.0/24 121.6.0.0/15 165.21.0.0/16 180.210.200.0/21 182.23.147.0/24 192.169.40.0/23 203.92.64.0/18 203.117.0.0/24 218.186.0.0/16 218.212.0.0/16 219.74.0.0/15 219.75.0.0/17

# Taiwan (TW)
deny from 1.160.0.0/12 1.200.0.0/16 59.124.0.0/14 60.198.0.0/15 60.249.0.0/16 60.250.0.0/15 61.31.0.0/16 61.59.0.0/16 61.67.128.0/17 61.216.0.0/14 61.220.0.0/14 61.224.0.0/14 61.228.0.0/14 110.24.0.0/13 110.50.128.0/18 111.240.0.0/12 114.24.0.0/14 114.32.0.0/12 115.80.0.0/14 115.85.144.0/20 117.19.0.0/16 118.160.0.0/13 122.116.0.0/15 122.120.0.0/13 122.254.0.0/18 123.240.0.0/15 124.8.0.0/14 125.224.0.0/13 140.109.0.0/16 140.110.0.0/15 140.112.0.0/12 140.128.0.0/13 140.136.0.0/15 140.138.0.0/16 163.13.0.0/16 163.14.0.0/15 163.16.0.0/12 163.24.0.0/16 163.32.0.0/16 203.64.0.0/14 203.71.0.0/16 203.72.0.0/16 210.59.0.0/17 210.200.0.0/15 210.240.0.0/16 211.20.0.0/15 211.23.0.0/16 211.75.0.0/16 211.76.160.0/20 211.79.32.0/20 218.160.0.0/12 219.84.0.0/15 219.90.3.0/24 220.128.0.0/12

# Thailand (TH)
deny from 1.46.0.0/15 58.8.0.0/16 58.9.0.0/16 58.10.0.0/16 58.137.0.0/16 61.19.64.0/18 61.19.205.0/24 61.19.240.0/20 61.47.0.0/17 113.53.0.0/17 115.87.128.0/17 117.47.0.0/16 118.172.0.0/14 122.154.0.0/15 123.242.128.0/18 124.120.0.0/16 124.121.0.0/16 124.122.0.0/16 125.25.0.0/19 171.97.128.0/17 202.28.0.0/15 202.44.135.0/24 202.133.128.0/18 202.143.128.0/18 203.107.142.0/24 203.113.0.0/17 203.130.149.0/24 203.144.128.0/17 203.148.128.0/17 203.149.0.0/18 203.150.128.0/17 203.151.38.0/24 203.155.0.0/16 203.158.96.0/19 203.158.128.0/17 203.170.193.0/24 203.172.128.0/17 203.185.128.0/19 210.213.0.0/18 222.123.0.0/16 223.205.0.0/16 223.207.0.0/16

# Vietnam (VN)
deny from 1.52.112.0/20 42.112.0.0/13 58.186.0.0/16 58.187.96.0/20 58.187.112.0/20 112.78.0.0/20 112.197.0.0/16 112.213.80.0/20 113.22.0.0/16 113.23.0.0/17 113.160.0.0/11 115.72.0.0/13 115.84.176.0/22 116.96.0.0/12 117.0.0.0/13 118.68.0.0/14 123.16.0.0/12 125.234.0.0/15 171.224.0.0/11 183.81.0.0/17 183.91.0.0/19 202.78.227.0/24 203.113.128.0/18 203.162.0.0/16 203.210.192.0/18 210.245.80.0/21 220.231.124.0/22 222.252.0.0/14

</Files>


2. Me in compress most all of javascript files
Trying to arrange for all the javascript files are compressed. I use the service of Closure. Don't forget to click Reset Link before you use it. You just enter the URL of your file in there. There are three options of compression level, and you only have to adjust it. Once you click the Compile button, you will get a file compression results in the right column. If you get a warning message, lower the compression level, and repeat again to click the compile button.

What are the javascript file that I minimize? Almost all javascript files in folders static

This compression is important, at least in my opinion. Because the file size becomes smaller.

3. Me in compress most all of css files
a. Open your css file using Notepad or Notepad++ as free.
b. I usually use Yui to compress all css file in theme and on css static file on some module.
c. Open your css file one by one.
d. Copy your css code and paste in Code column on http://www.refresh-sf.com/yui/ >> Choose file type as css >> Push Compress button >> Push Download Compressed File >> copy and paste all css code compressed and replace your old code.
e. Remember to make back up for every your css file. This is important if you are going to edit your css.
f. Upload and replace your css file with the compressed one.
g. Clear your site cache.
h. Done

4. Me in combine multiple css files.
Here just example regarding combine multiple css file. In PhpFox, I used to do it for small files, and css files from the module. For example, I use it for ultimate search module. I bought it a few days ago. In this module open module/cfsearch/template/default/block/search.html.php

I change:
<script>$Core.loadStaticFile('{$sCoreUrl}module/cfsearch/static/css/default/default/cfsearch.css');</script>


to:
<script>$Core.loadStaticFile('{$sCoreUrl}theme/frontend/default/style/facebookish/css/custom.css');</script>


and then put all code in the cfsearch.css into custom.css

5. Me and image background
Use images as little as possible in your template. No matter how small the size of the image, the image still image. It has a link that will be also invoked by the browser. If it can be replaced only by a color code, then replace.

Example on #mobile_header{background:url('../image/layout/mobile_header.png') repeat-x;}

You can replace with: #mobile_header{background:#005C69;height:40px;margin:0 auto;width:100%}


It's because, that code have the same result to make a background using color #005C69 with dimension height 40px and width 100%.

6. Me and combine some images
You can also combine some images into one. I often use Spriteme services to do it. Work fine on Firefox. With this service, you will be given a new image sprite with the new code, and how position of the image in the css code.

Just an example is:


This image is combine from holder_notify_friend_request.png, holder_notify_message.png, holder_notify_notification.png, main_search_bar_button.png, activity_feed_form_attach.png, profile_photo.png, and 5 others pictures.

7. Me and image
Based on gtmetrix's suggestion, we also need to give a dimension, alt and title for our image. Example is for banner.png on homepage. We can add width='530px' height='245px' alt="some-text-here" title="" for our image. It's will help your site score and SEO. This also applies to the logo and others.

Especially for the user pictures on homepage, I decided not to display it. This will reduce the number of http requests. If you're going to do it, you can delete this code:

<div class="user_welcome_images">{foreach from=$aUserImages name=userimages item=aUserImage}{img user=$aUserImage suffix='_50_square' max_width=50 max_height=50}{/foreach}</div>


in module/user/template/default/images.html.php


I actually have a few other tricks, but I think it's enough because my time is somewhat limited.

Thank you