Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

htaccess driving me nuts!


LisaT

Recommended Posts

Posted

I have been struggling all day to get htaccess to password protect my catalog/admin directory so that only authorised people can access the admin pages. I contacted my web host and they told me to look at a tutorial online. So,

I followed the very clear instructions on http://www.htmlgoodies.com/tutorials/getting_started/article.php/3479531' target='_blank'> - although he does neglect to tell you to upload in ASCII

But when I tried to access the admin pages I got a Page Not Found message.

I see that there is already a .htaccess file in my directory on install. Am I meant to overwrite that? Should I putting the .htpasswd file in a particular directory?

What am I doing wrong?

Please help as everything else about the install has gone really well

Posted

hmm dont owerwirte the htacces in the catalog or admin folder. Make a new folder ex call it pass and put your real admin dir + your new htacces and the other password files into that

 

 

/catalog/pass/admin

/catalog/pass/htacces etc.

 

 

Remember to change path to admin dir if you change it.

 

 

Hopes that will help

 

 

From Emil Larsen

Posted
hmm dont owerwirte the htacces in the catalog or admin folder. Make a new folder ex call it pass and put your real admin dir + your new htacces and the other password files into that

/catalog/pass/admin

/catalog/pass/htacces  etc.

Remember to change path to admin dir if you change it.

Hopes that will help

From Emil Larsen

 

 

Uh, I've had this same problem and I did replace the htaccess file for my admin directory. Things seem to work okay, but is it necessary for me to revert back and add a buffer directory like you suggest? Do you know what the original htaccess does?

 

Thanks,

JD

Posted

original /admin .htaccess file

 

# $Id: .htaccess,v 1.1 2003/06/20 00:18:30 hpdl Exp $
#
# This is used with Apache WebServers
#
# For this to work, you must include the parameter 'Options' to
# the AllowOverride configuration
#
# Example:
#
# <Directory "/usr/local/apache/htdocs">
#   AllowOverride Options
# </Directory>
#
# 'All' with also work. (This configuration is in the
# apache/conf/httpd.conf file)

# The following makes adjustments to the SSL protocol for Internet
# Explorer browsers

<IfModule mod_setenvif.c>
 <IfDefine SSL>
   SetEnvIf User-Agent ".*MSIE.*" \
            nokeepalive ssl-unclean-shutdown \
            downgrade-1.0 force-response-1.0
 </IfDefine>
</IfModule>

# Fix certain PHP values

#<IfModule mod_php4.c>
#  php_value session.use_trans_sid 0
#  php_value register_globals 1
#</IfModule>

Posted

The simplest way to protect your 'admin' folder is to use the Directory Protection or Password Protect feature available in your web hosting control panel. This feature writes the .htaccess and .htpasswd files for you.

 

Vger

Posted

Hello,

 

I don't have the option to secure any directory using the control panel of my webhost.

I created the .htaccess and the .htpasswd using a .htaccess and .htpasswd Code Generator.

After installing this I do get a logon screen but I can't login.

 

Then I used another generator but had the same problem, I can't login.

 

I also noticed that both generaters encrypted my password different.

 

Can someone please tell me (in simple words) how i can protect my admin folder?

 

Thank you.

Posted

There are several possible reasons as to why .htaccess is not working for you:

 

1. Your hosting company does not allow the use of any files beginning with a period (dot) - such as Yahoo, Lycos

2. Your .htaccess file is not written correctly - and this can vary according to which type of server you are on.

3. You are on a Windows server, in which case .htaccess won't work anyway - as it is a feature of Apache. For Windoze servers you need to create a Login based on a text file e.g.

User = abc

Pass = 123

 

Vger

Posted

So I can't just use any code generator?

I first have to check wich server my webhost uses, right?

Posted

Yes, the good code generators give you multiple options to create your .htaccess files, based on your type of server.

 

Vger

Archived

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

×
×
  • Create New...