There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
Web Design & Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
htaccess file troubles


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
smooth's Avatar
Distinguished Member with 3,485 posts.
 
Join Date: Sep 2005
Location: NC, USA
Experience: Learning everyday :)
14-Nov-2005, 10:54 AM #1
htaccess file troubles
Hello again,

I want to use an htaccess file and htpassword file on a site, to authorize users to visit a site.

Now, my .htaccess file has this in it:

Code:
AuthName EnterPassword
AuthType Basic
AuthUserFile /server/directory/subdirectory/.htpassword
Require valid-user
The actual names being different than server, directory, and subdirectory.

Now, this is what I have in my .htpassword file:

Code:
username:TJdd28.XTOGM2
Just using username as a test one, and the password encoded using a form I found online.

Now, I put the .htaccess file within the directory that I want protected, and the .htpassword file is a step above that directory, because I've been told to put this in a directory that cannot be accessed using www.

I can't get it to work however. Just isn't doing anything, except going straight to my index file in that directory, without asking for a username or password. Any ideas?
__________________

Meet Your Fellow TSG Members :: Find Out What CWLMST Means :: NCAA Football :: NCAA Basketball


Looking forward to meeting you up in heaven angel

I don't care how bad I feel, when I go to work I make sure I give it my all! Never any less than 12%...

47.5% of all statistics are made up right on the spot

When something is done in ignorance, then its always best to admit that you have no excuse, fix the problem, put it behind you, and move on - valley
Squashman's Avatar
Distinguished Member with 12,604 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
14-Nov-2005, 11:26 AM #2
Are you doing this on a webhost or is this your server?
Are you sure your webhost is an Apache server and do they allow you to use .htaccess files?
What are the permissions on the .htaccess and .htpassword files.

I take it you have read this tutorial.
http://www.javascriptkit.com/howto/htaccess3.shtml
__________________
I hate asking the same question twice!
How to ask questions the smart way!
Microsoft MVP - Windows Shell/User
smooth's Avatar
Distinguished Member with 3,485 posts.
 
Join Date: Sep 2005
Location: NC, USA
Experience: Learning everyday :)
14-Nov-2005, 11:29 AM #3
Hey Squashman,

I'm doing it on a webhost. I'm pretty sure they support it, since when i called tech support, he said I would have to set up .htaccess in order to do what I want to do.

I'm not sure how to set the permissions on the files. I read through that tutorial before, and it doesn't seem to tell how to do that.
__________________

Meet Your Fellow TSG Members :: Find Out What CWLMST Means :: NCAA Football :: NCAA Basketball


Looking forward to meeting you up in heaven angel

I don't care how bad I feel, when I go to work I make sure I give it my all! Never any less than 12%...

47.5% of all statistics are made up right on the spot

When something is done in ignorance, then its always best to admit that you have no excuse, fix the problem, put it behind you, and move on - valley
Squashman's Avatar
Distinguished Member with 12,604 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
14-Nov-2005, 11:34 AM #4
How did you create the .htaccess and .htpasswd files. A common mistake people make is when they create them in notepad, they don't name the file correctly. They end up naming .htaccess.txt or they dont upload it as a ascii text file.

What ftp application are you using to upload the files to your webhost. It should have the capability to show you the file permissions? Do they allow you to have Secure Shell access?
__________________
I hate asking the same question twice!
How to ask questions the smart way!
Microsoft MVP - Windows Shell/User
smooth's Avatar
Distinguished Member with 3,485 posts.
 
Join Date: Sep 2005
Location: NC, USA
Experience: Learning everyday :)
14-Nov-2005, 12:19 PM #5
I created them both in Notepad, and changed the setting to All Files. Also, when I upload them, they are shown as HTACCESS file type and HTPASSWORD file type.

When I view there permissions in my ftp program (Filezilla) it shows -rwxrwxrwx for both, so it has every persmission for both of them. Not sure about the Secure Shell Access, nor what that is.

I had been advised to use a PHP one, but my host does not use php. So I've also been looking for some ASP scripts that are good, since my host does support ASP. I figured the .htaccess would be a quick fix, as I would have to learn how to configure everything in the ASP ones.
__________________

Meet Your Fellow TSG Members :: Find Out What CWLMST Means :: NCAA Football :: NCAA Basketball


Looking forward to meeting you up in heaven angel

I don't care how bad I feel, when I go to work I make sure I give it my all! Never any less than 12%...

47.5% of all statistics are made up right on the spot

When something is done in ignorance, then its always best to admit that you have no excuse, fix the problem, put it behind you, and move on - valley
Squashman's Avatar
Distinguished Member with 12,604 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
14-Nov-2005, 01:45 PM #6
I can't believe they support ASP on a unix/linux server. That costs money for the web host. Doesn't cost them anything to support Perl or PHP.

Could you give me a link to your webhost or the link to your website.
Squashman's Avatar
Distinguished Member with 12,604 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
14-Nov-2005, 01:47 PM #7
Now that I think of it. If it is a linux or unix server, the file and path names are case sensitive. If your file name is uppercase, I would change it to lower case. Did you make sure you uploaded them as ascii text.
smooth's Avatar
Distinguished Member with 3,485 posts.
 
Join Date: Sep 2005
Location: NC, USA
Experience: Learning everyday :)
14-Nov-2005, 01:50 PM #8
The web host is 1and1.

I'm not sure how to upload it as ASCII text. Is there usually a setting in the ftp program for that?
smooth's Avatar
Distinguished Member with 3,485 posts.
 
Join Date: Sep 2005
Location: NC, USA
Experience: Learning everyday :)
14-Nov-2005, 01:54 PM #9
Ok, under filezilla, it says if I Auto-Detect, then it will automatically transfer certain files as ASCII. So I added .htaccess and .htpasswd as the file types. Then I re-uploaded the files. Still didn't work though.
Squashman's Avatar
Distinguished Member with 12,604 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
14-Nov-2005, 02:25 PM #10
You have .htpassword above but now you have it has .htpasswd?
Did you make sure everything is in lower case?

Since they offer both Microsoft and Linux hosting, we really need to know which one you are using as well. If you can tell me this or give me what your website is I can check this really easy with a utility I have.
__________________
I hate asking the same question twice!
How to ask questions the smart way!
Microsoft MVP - Windows Shell/User
smooth's Avatar
Distinguished Member with 3,485 posts.
 
Join Date: Sep 2005
Location: NC, USA
Experience: Learning everyday :)
14-Nov-2005, 02:31 PM #11
IFG Agent Recruit is one of our domains with the host. We have 3 total.

I want to implement the htaccess to IFG Agents if I can. Right now it is just a protected directory, that has 1 username and password that is universal for all agents. I want to use the htaccess so that I can have a username and password for multiple users, so if someone leaves the company, they can't still get in.

Oh, and I had the file named .htpassword, but changed it to .htpasswd, since I saw on the sites I've looked at, most of them have it named that way. I wasn't sure if the longer than 8 letters after '.' would effect that.

The file names are in all lowercase as well. It must have something to do with where I am placing the files at.

Right now, I am testing it at the IFG Agent Recruit site, since I don't want to mess with the protected directory of our agents site, until I get this to working correctly. You can see where I am testing it at, right here.

The .htpasswd is above the /test directory. The .htaccess file is in the /test directory, with the index.html.
__________________

Meet Your Fellow TSG Members :: Find Out What CWLMST Means :: NCAA Football :: NCAA Basketball


Looking forward to meeting you up in heaven angel

I don't care how bad I feel, when I go to work I make sure I give it my all! Never any less than 12%...

47.5% of all statistics are made up right on the spot

When something is done in ignorance, then its always best to admit that you have no excuse, fix the problem, put it behind you, and move on - valley
Squashman's Avatar
Distinguished Member with 12,604 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
14-Nov-2005, 02:36 PM #12
Your .htpasswd file is in a web accessible directory.
Squashman's Avatar
Distinguished Member with 12,604 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
14-Nov-2005, 02:39 PM #13
It is an IIS server. .htaccess is only available with Apache.
I know there are a few ASP password scripts but can't remember any of them off hand.
smooth's Avatar
Distinguished Member with 3,485 posts.
 
Join Date: Sep 2005
Location: NC, USA
Experience: Learning everyday :)
14-Nov-2005, 02:39 PM #14
Grr
Oops, I think that will only be true in the test site, however.

When I actually implement it, I am going to put it in the folder above my agents site. When I login to my ftp, I have it laid out where I have 3 folders, one for each site. agents, main_site, and recruiting.

I am going to put the .htpasswd file in the root, above all of those folders. I don't think it will be accessible via www then, since the my agents site would be in the folder.
__________________

Meet Your Fellow TSG Members :: Find Out What CWLMST Means :: NCAA Football :: NCAA Basketball


Looking forward to meeting you up in heaven angel

I don't care how bad I feel, when I go to work I make sure I give it my all! Never any less than 12%...

47.5% of all statistics are made up right on the spot

When something is done in ignorance, then its always best to admit that you have no excuse, fix the problem, put it behind you, and move on - valley
Squashman's Avatar
Distinguished Member with 12,604 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
14-Nov-2005, 02:40 PM #15
I doubt they would install this for you.
http://www.troxo.com/products/iispassword/
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 06:04 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.