Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

htaccess problems in admin folder with a root dir install


Guest

Recommended Posts

Just can't figure this one out: I did an installation in the root directory but for the life of me can't get the htaccess file to function for password protecting the admin folder...argh!

 

It is returning a 500 Internal server error along with a 404 page error. I am using the same htpasswd and htaccess files from the osxdoc (not sure if that's right) installation guide that has worked successfully many times doing the standard mydomain/catalog/admin installation. I tried using the folder protect htaccess function with the Cpanel hosting which has ALSO worked on the standard mydomain/catalog/admin installation but it too is giving me the same 500 error.

 

If I don't use htaccess, the admin section comes up just fine...other than not being protected.

 

Is there something I missed during installation? From what I can tell everything else on the site is functioning as it should...

Link to comment
Share on other sites

Ingredients

NOTE: Please make sure you are setting this up in the directory that you want passwd protected. The .htpasswd file will end up in the wrong directory otherwise. For more infomation on how to use Unix, please check out our Unix Tutorial.

 

 

The web document to be protected.

Actually, access is restricted by directory so all files in the same directory will be protected.

 

 

The file .htaccess.

This file should be in the directory which contains the documents to restrict access to. The contents of this file specify the name of the password file.

 

For example if you were user jdoe with web documents in the local directory "/home/jdoe/public_html/goodstuff" that you wanted to restrict access to, your .htaccess might look like:

 

AuthUserFile /home/jdoe/public_html/goodstuff/.htpasswd

AuthName jdoe_goodstuff (no spaces)

AuthType Basic

<Limit GET>

require valid-user

</Limit>

 

Note that .htaccess will not work if there are extra spaces after AuthUserFile.

 

 

The file .htpasswd.

This file contains the passwords of the users.

 

To create the .htpasswd file log in to this server using telnet, change directory to the directory you want to restrict access to, and type:

 

htpasswd -c .htpasswd someuser

 

for the first user (where someuser is the username). You will then be prompted twice for the user's password. The -c option causes the .htpasswd file to be created. For each additional user type:

 

htpasswd .htpasswd someuser

 

 

Hope this helps

 

Gary

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...