Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

I need help protecting my Admin folder


Spice

Recommended Posts

Posted

Hi

 

I need help to protect my admin folder with .htaccess so it will ask for user/pass when I try to access it. How should I do please help.

Posted

Hello,

 

you can create an .htaccess file in the directory.. should look like:

 

AuthUserFile /www/shop/admin/.htpasswd

AuthGroupFile /dev/null

AuthName "Description"

AuthType Basic

<Limit GET>

require user username

</LIMIT>

 

after this, create an .htpasswd file using htpasswd -c /directory/.htpasswd username

 

after this, you should have setuped it!

Posted

So I add this to the .htaccess file

 

AuthUserFile /www/shop/admin/.htpasswd

AuthGroupFile /dev/null

AuthName "Description"

AuthType Basic

<Limit GET>

require user username

</LIMIT>

 

Should I make this file manually or does that line

htpasswd -c /directory/.htpasswd username create one.

 

Someone told me to run that in a comand promt or something but I dont know how to.

Or should I manually make a .htpasswd file and adding what to it?

I have made a empty .htpasswd file but what should be in it.

 

And this /directory/.htpasswd the directory must be the correct path to the admin folder right?

 

sorry for being lost.

Posted

Hello again,

 

-c means to create a new .htpasswd. if its once created you dont need to use the -c option again!

 

you have to run it using the command line. otherwise use an php-script which is able to create this files... you can go to www.phpwelt.de to download a .htaccess and .htpasswd file.. just go to this page and search for .htaccess.

 

how to create a .htpasswd file localy and upload it using ftp i dont know how... because the passwords in the .htpasswd are encrypted.

 

> And this /directory/.htpasswd the directory must be the correct path to the admin folder right?

 

 

yes...

 

good look

Posted

ups... s.th wrong...

 

> And this /directory/.htpasswd the directory must be the correct path to the admin folder right?

 

the .htpasswd can be anywhere on the server. you have to define the path to this file in the .htaccess file (AuthUserFile /www/shop/admin/.htpasswd) ... for security it would be better to create it outside the www directory... the .htpasswd file has to be located in the admin folder..

Posted

ok

 

but I still cant create the .htpasswd file =/

I have the .htaccess file but seems hard to make the .htpasswd file with my current host. Im in the middle of getting a new host thats better.

Archived

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

×
×
  • Create New...