".htaccess"

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Labbat
Forum Newbie
Posts: 15
Joined: Mon Jan 26, 2004 9:10 pm

".htaccess"

Post by Labbat »

Hello,
Recently I was playing with a free server, and it was quite simple to set up the ".htaccess" File..
Alls, I had to do is make the script, then make the ".htpasswd" File, and it worked...
Now, Im not going to use a free server for a number of reasons, Such as: Ill be buying my own server soon here, I just had a few unexpect expenses with my family here...
Secondily, they decorate your site with a bunch of their adds
(I guess thats how they get advertising)
Thirdly, most free hosts dont support PHP...

Anyways, right to the point:
I tried putting my ".htaccess" File, and my ".htpasswd" File on my personal Apache Server.....However, it didn't work...So I started reading tutorials on google.ca about getting it to work, but the furthest Ive got was "You have to tell apache to turn the .htaccess feature on " Then it went on to explain a few things I didn't really understand beneath that...(2 paragraphs)
Why does the Programmers/makers of Apache have to make everything such a pain in the *** hehe....Alright,

my question is, could some-one tell me kinda a step by step explaination of how to get my ".htaccess" File to work?
I understand I have to turn it on in one of the Config Files for Apache? I believe, but beyond that, Im not too sure, where or how .... Thanks
User avatar
ol4pr0
Forum Regular
Posts: 926
Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador

Post by ol4pr0 »

Well it got something to do with youre httpd.conf.


Loook this up in youre conf.
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All ( <----------- and make it AllowOverride All )

:-)
Labbat
Forum Newbie
Posts: 15
Joined: Mon Jan 26, 2004 9:10 pm

Re: ' .htaccess '

Post by Labbat »

Hey, ok, Im looking for something that matches what you posted....
Ill show you what I found:

# This controls which options the .htaccess files in directories can
# override. Can also be "All", or any combination of "Options", "FileInfo",
# "AuthConfig", and "Limit"
#
AllowOverride All

I changed it to AllowOverride All
At the bottom there...

But I dont know if thats the right spot - to change it?
- Let me know

Thanks
Illusionist
Forum Regular
Posts: 903
Joined: Mon Jan 12, 2004 9:32 pm

Post by Illusionist »

Yes, there is only 1 AllowOverride in the ini file
Labbat
Forum Newbie
Posts: 15
Joined: Mon Jan 26, 2004 9:10 pm

Got htaccess to work, now htpasswd

Post by Labbat »

Hey guys, I got my
' .htaccess ' to work....
http://142.59.59.29/www/admin/
However, this is what my htpasswd file looks like

admin:wLhGEkTk9tqkA

Now thats not my password....I used this thing I found off a website it said "Ecrypt Your Files here" Or something like that
so it said, enter your user name and pass word, so I entered
admin and k7YuHeFv

And it encrypted it too
admin:wLhGEkTk9tqkA

So it said to use that for my htpasswd file, so I did

Now I go to my URL, and enter that as my Password, and it doesn't let me login, because , I assume its thinking wrong password.... So should I just changed the encrypted B.s.
Too the password I want, or how does this work?
User avatar
ol4pr0
Forum Regular
Posts: 926
Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador

Post by ol4pr0 »

.htaccess always asks for a full path to the .passwd ;-)

So in youre case that might be.. on a local host.


/root/dir/of/website/ ( no c:\ .. or whatever.

something like

www/bin/.passwd ;-)

on a remote hosted site..

/start point when yo login with a ftp client /to /path/of /.passwd ;-)
Post Reply