1. Create a blacklist to prevent site access from certain IP addresses.Websites are made to have visitors. However, those guests can occasionally become a problem. Sometimes, there are certain site visitors that are no longer welcome. Htaccess files can be used to block those particular visitors. This is also useful to keep bots away from your site. The code used to create your blacklist is as follows: <limit get="GET" post="POST" put="PUT"> order allow,deny allow from all deny from 123.456.789 deny from 93.121.788 deny from 223.956.789 deny from 128.456.780 </limit> You can add as many IP addresses as you want this way to keep your site free of troublemakers. If someone is spamming your site, this little piece of code is your new best friend. 2. Create a redirect while performing site maintenance. While you’re performing site maintenance, you want visitors to be redirected to a page that lets them now what’s going on and maybe when your site is expected to be open to visitors again. You can use the htaccess file to accomplish this using the following code: RewriteEngine on RewriteCond %{REQUEST_URI} !/maintenance.html$
Share This