Redirect to maintenance page during upgrade using .htaccess

advertisement

Redirect your visitor to maintenance page is a must when you are upgrading your site. Now you can redirect your user to maintenance page easily by using .htaccess file. I guess you do not want your visitor to see an error page or 404 page during your dedicated server upgrade. So just follow the steps below to create a .htaccess file to redirect your visitor to maintenance page during upgrade:-
Continue reading Redirect to maintenance page during upgrade using .htaccess »

Block IP from accessing website using .htaccess

advertisement

To block certain ip address from accessing your website, just create a file with name .htaccess at your root directory with the content below:-

order allow,deny
deny from 192.168.0.1
allow from all

If you want to block multiple ip address using .htaccess simply add one ip address per line as below:-
Continue reading Block IP from accessing website using .htaccess »

Password protect directory with .htaccess and .htpasswd

advertisement

If you have some files to share among friends in your web server, you can use .htaccess to password protect your directory. To enable this password protect directory feature without any web control panel (ex: CPanel, Ensim, DirectAdmin or etc) is a bit troublesome. No worry, the tutorial below will teach you how to password protect directory using shell or CPanel.

To password protect your website folder with shell command:-
Continue reading Password protect directory with .htaccess and .htpasswd »