Let's check how to add password protection to directories, there are many ways to add password protection to a directory. Here lets see how doing this with .htaccess. It is the built-in feature in Apache using htaccess method. By doing this we could restrict access to certain users or search engines.
.htaccess
A few Drupal users using Drupal Boost were encountering a situation where the manual changes they made to the Boost generated .htaccess file like uncommenting the SetHandler Drupal_Security_ Do_Not_Remove_See_SA_2006_006 directive was getting rewritten during CRON runs. If you are encountering the same situation in your Drupal site when using Boost then read on to find out more.
Password-protecting drupal development site with .htaccess file
There might be few scenarios when we need to protect our site from the general public and make it accessible to a selected group of users. One of the most common scenarios in the development workflow of a Drupal site is when you want to avoid your half-complete drupal site showing up in Google search results.For such needs, it is advisable to go for password-protecting the site using HTTP authentication.
If you have cPanel installed on your hosting server, you can use the ‘Password Protect Directories’ option from the ‘Security’ section on the cPanel home page. Click here to read on How to enable HTTP Authentication using cPanel (link to an article for the same on our site)
For those without cPanel, here’s how to get Apache work your way:
A VPS lies somewhere in between shared hosting and dedicated servers in terms of the features it provides. VPS divides the server’s primary resources and gives you certain amount of diskspace, memory, processing speed and bandwidth, with freedom on the OS configuration. In the case of shared hosting its like a common pool from which you consume bandwidth, diskspace, and processing power until it is exhausted. You dont get much control over the OS config.
In a common secnario if a user types the url of a Drupal based website without the 'www'.prefix they will be automatically redirected to the required site with the complete url. This is very convenient for most web users who do not want to type in the obvious 'www' prefix. Webmasters can configure this by changing the settings of the Drupal .htaccess file. However this will be a problem if the Drupal site has a mobile version with an 'm.' prefix. Users wishing to access the mobile version of that Drupal site will inevitably be redirected to the main website.
Zyxware is conducting a Drupal workshop in association with COMSOC of College of Engineering Trivandrum and IEEE Student Branch of Younus College of Engineering and Technology. The workshop will be held at Central Computer Facility, College of Engineering Trivandrum on the 20th of August 2011. You can register for the workshop at http://ieeesbcet.org/stac-drupal-workshop/