Stop PHP errors by using .htaccess file

Just paste the given below file in a .htaccess file and put it in a web directory(generally root) and see the magic, dont forget to provide a log file at the end if you want to store all errors.

php_value error_reporting 2047
php_flag display_errors false
php_flag display_startup_errors false
php_flag log_errors true
php_value log_errors_max_len 100M
php_flag html_errors false
php_value log.txt ../log

Block Hot linking

Hey Guys,

If you want to prevent users from directly linking to images on your site that is called hot linking then you can use this code in .htaccess file to prevent this action.

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?site.com/.*$ [NC]
RewriteRule \.(gif|jpg|png)$ – [F]

it will deny the access to that image, additionally you can open a error page too by writing this instead of last line in the above code

RewriteRule \.(gif|jpg|png)$ http://www.site.com/error.html [R,L]