evald Posted March 16, 2006 Posted March 16, 2006 Hello! Could some one help me? When I go to to http://localhost/catalog/admin/* directory nothing is protected with my own password! I have read in documentation that some manipulation must be done with .htacess file, but with which htaccess file it must be done and what. Please, anybody help me!
Avec Posted March 16, 2006 Posted March 16, 2006 From an earlier post This should help It is fairly easy. 1. You need to find your server absolute address. (This is the part that gave me the most problems.) It is not the one recorded in your configure.php files. To get the correct one, I had to go to my host-provided control panel and look in CGI information. There is gave my path as usr/local/psa/ etc. Yours may differ. 2. Go to http://www.webmaster-toolkit.com/htaccess-generator.shtml Enter a user name and password you want to use and the path from step 1. The path entered needs to include the path to where your password file will be. It needs to be in a secured area as well, so put it in the directory you want to protect. Assuming you are protecting your Admin directory, the path should be the server path from above/yourdomain.com/httpdocs/admin 3. The htaccess generator gives you entries for two files, htaccess (which is already in your directory) and htpasswd (which is not in your directory). Add the output for htaccess to that file in the directory you want to protect. The output for htpasswd should be copied and pasted in a text file (the stuff after your login is the encyrpted password). Name the text file htpasswd.txt. Upload the file to the same directory you want to protect. Once it is there, change the name to .htpasswd (add a dot to the front and remove the .txt at the end) You may need to use a couple of different methods to upload and modify the names of the files. I cannot change a name of a file using my host-provided file manager, but I can modify the content. However, I can modify the name of a file using my FTP program (Filezilla) but once I add the leading . to the two files, I can no longer see them. 4. You should now be protected. To test things, I had a couple browser windows open at the same time. I had the host-provided file manager open to the .htaccess file in one window and in another I tried to open the now protected file (http://yourdomain.com/admin) to see if it: 1) asks for a password and 2) opens when you type in your login and password. It should work for you. If there is a problem it is probably the path information in htaccess. This is what caused me the biggest problems. Using this, you can easily create other protected directories using the same login and password, or have different ones. You can also have more than one login password in the htpasswd file to allow more than one person in, each with their own login.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.