Section .htaccess

shell: mirror a directory with lftp

Written by on 28/11/2014
Category:   Linux, Shell
Migrating a large website (several gigabytes) can be a tedious task to do from your workstation (with filezilla, for example). If you have a machine at a hosting provider with shell access, the lftp solution can quickly prove to be the ultimate alternative.Retrieve the files:lftp -e 'mirror /repertoir/distant /repertoir/local' -u login,password -p 21 www.host.comSend the files:lftp -e 'mirror -R /repertoir/local /repertoir/distant' -u login,password -p 21 www.host.comSend the files with 10 si...

Apache: PHP Directives in the .htaccess File

Written by on 15/05/2014
Category:   Apache
Tags:   .htaccess, Apache
Here is a non-exhaustive list of PHP directives that can be added to the .htaccess file: php_flag display_errors Off error_log = /path/filename php_value date.timezone 'Region/Zone' php_value max_execution_time 30 php_flag register_globals Off php_flag magic_quotes_gpc Off php_value upload_max_filesize 200M php_value post_max_size 200M php_value memory_limit 20M php_value max_input_vars 100

Apache: Enable Compression

Written by on 15/05/2014
Category:   Apache
Tags:   .htaccess, Apache
To enable compression in Apache, you have two options; The first is to insert the directives into the .htaccess file, and the second is to place these directives directly in the declaration of your vhost. <ifModule mod_gzip.c> mod_gzip_on Yes mod_gzip_dechunk Yes mod_gzip_item_include file .(html?|txt|css|js|php|pl)$ mod_gzip_item_include handler ^cgi-script$ mod_gzip_item_include mime ^text/.* mod_gzip_item_include mime ^application/x-javascript.* mod_gzip_item_exclude mime ^i...