Server-side redirects: .htaccess versus Meta Redirects
URL redirects are needed for a number of reasons. One example is when you have changed significant portions of your website, and then have to deal with the problem of people finding their way from the old pages to the new pages. There are different ways of redirecting pages, through Meta tag http-equiv, JavaScript or any of the server-side languages. And what’s more, you can do it through .htaccess, which is probably the most effective, considering the minimal amount of work required to do it.
Server-side redirects: .htaccess versus Meta Redirects - Password Protection / Authentication (Page 3 of 6 )
Have you ever wanted a specific directory in your site to be available only to certain people? Have you ever found yourself frustrated with the holes in client-side options for this that allowed virtually anyone with enough skill to mess around in your source to get in? Then htaccess is the answer! There are numerous methods that let you password protect areas of your website, some server language bases (such as Java, PHP or ASP) and client-side-based, such as JavaScript. Htaccess is about as secure as you can or need to get in everyday life, though there are ways above and beyond even those of htaccess.
For example if you had uploaded some photos to your web site under the path - /album/ and want to share the photos ONLY with your girlfriend named Jessica, that name would need to be specified. The first thing you will need to do is create a file called .htpasswd or something else you like. You can use the httpd build-in program with the Apache Server called htpasswd.
>htpasswd –c /local/usr/.htpasswd Jessica
The program will prompt you to enter the password for the user Jessica, and then a file .htpasswd is created and stored in the path /local/usr/.htpasswd.
Secondly, you need to create the .htaccess file and place it under the /album/ directory with the following content:
AuthType Basic
AuthName EnterPassword
AuthUserFile /local/usr/.htpasswd
Require user Jessica
The above code fragment indicates that it will use Basic Authentication to authenticate the user, and only the user Jessica is allowed access to the /album/ directory.