Turn Off directory browsing on Apache

If your apache is chowing a indexes when browsing /var/www directory tree it might be considered as a security weakness. Unless you need your users to browse entire directory tree you may need to change a default apache setting in /etc/apache2/sites-available/yousite :
FROM:

Options Indexes [...]

Using .htaccess file to redirect to www host

Sometimes we would like to instruct apache to redirect all incoming visitors from our_sample_domain.com to www.our_sample_domain.com
to do this we need to amend .htaccess file as follows:
# RewriteCond %{HTTP_HOST} ^our_sample_domain.com\.com$ [NC]
# RewriteRule .* our_sample_domain.com/ [L,R=301]