Php-Configuration Control Through .htaccess

The .htaccessfile is very powerful and can control more than just
URL structure. For instance, you can control PHP configuration
options using the .htaccessfile. To increase the memory
allotted to PHP use this command:

php_value memory_limit 64M

This increases the memory limit in PHP to 64 MB.
You can also increase the max file size upload
and post size:

php_value upload_max_filesize 20M
php_value post_max_size 20M

Now the maximum file size you can post from a form and upload
is set to 20 MB. Most hosting companies set these values to
around 2 MB by default so these are settings that will be used often
for larger file uploads. Not all hosting companies will allow these
values to be set in your .htaccess file, and they could create an
error on your website if that is the case.

The .htaccessfile can also be used for security purposes.
 Using .htaccessallows you to restrict access to your website
by IP address, essentially locking it down from anonymous visitors. To lock
down your website by IP addresses, add the following code to your .htaccessfile:

AuthUserFile /dev/null
AuthGroupFile /dev/null
AuthName "Access Control"
AuthType Basic
order deny,allow
deny from all
#IP address to whitelist
allow from xxx.xxx.xxx.xxx

Replace xxx.xxx.xxx.xxx with any IP address that you want to grant
 access to your website. You can have multiple allow fromlines so add
 as many IP addresses as you need. This allows access to
your website only if you are using an IP address defined here.