Security Tips

Author: Boby
Added: February 24, 2006

Some hints and tips on security issues.












Quote:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang='en'>
<head>
<title>Redirecting...</title>
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="Expires" content="-1" />
<meta http-equiv="Cache-Control" content="no-cache" />
<meta name="robots" content="noindex,nofollow" />
<meta http-equiv="refresh" content="0; url=http://www.yourphpldsite.com/index.php" />
</head>
<body>
</body>
</html>

This will redirect a user browsing http://www.yourphpldsite.com/templates/ to your main page.
Another good method is to protect your .tpl files with ".htaccess"










Code:
# Protect template files
<Files ~ "\.(inc|inc.php|tpl)$">
  Order deny,allow
  Deny from all
</Files>

This will stop anyone from looking at your http://www.yourphpldsite.com/templates/main.tpl file for example.
To protect all directories you can eighter create in each directory you want to protect a ".htaccess" with following code:










Code:
Deny from all

...or you can redirect users browsing directories they shouldn't have to your main page by using this code in your main ".htaccess" file:










Quote:
RedirectMatch permanent ^/directory/(admin(/.+)?|backup|images|include|install(/.+)?|lang|libs(/.+)?|templates)/?$ http://www.yourphpldsite.com/directory/

If you have not installed phpLD in a folder, remove the highlighted part of code.










Code:
find /your_path -name "*~*" -exec rm -f '{}' \;

If you have other tips, feel free to post them or comment on mine 
Boby