Add the following code some where in your htaccess file: They are both similar but different approach depending on your likes!
Options +FollowSymLinks
RewriteEngine On
redirectMatch 301 ^(.*) http://www.domain.co.uk/$1
OR
Options +FollowSymLinks
RewriteEngine On
RewriteRule (.*) http://www.domain.co.uk/$1 [R=301,L]
NB:
Please REPLACE www.domain.co.uk in the above code with your actual domain name.
Open your htaccess file and under the line:
RewriteEngine On
Add the following line:
RewriteCond %{HTTP_HOST} ^domainname.com [NC]
RewriteRule ^(.*) http://www.domain.com/$1 [L,R=301]
If you want to secure your site with a basic authentication using .htaccess file here are simple instructions on how to do it.
Get yourself to a .htaccess Password Generator site such as this dynamic drive
Copy the files (.htaccess and .htpasswd) files to your site folder.
All sorted!
Block directory browsing:
IndexIgnore */*
Here is how you can tell .htaccess file the location of the php.ini file
create .htaccess file in your local root folder and add the following line somewhere on top
SetEnv PHPRC /[path-to-document-root]/
Create or add to the current .htaccess file in the document root directory.
# .htaccess
php_value upload_max_filesize 20M
php_value post_max_size 20M
php_value max_execution_time 200
php_value max_input_time 200