Results 1 to 5 of 5

Thread: password

  1. #1
    Join Date
    May 2005
    Posts
    141
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default password

    i am trying to do this http://tools.dynamicdrive.com/password/ but cannot figure it out. right now, i have an .htaccess in my root which contains the following

    ErrorDocument 404 http://willie.envisionssoftware.com/web/home1.html
    AuthName "Restricted Area"
    AuthType Basic
    AuthUserFile /pages/protect/.htpasswd
    AuthGroupFile /dev/null
    require valid-user
    then i have a .htpasswrd which is located from the root at pages/protect/.htpasswrd in the folder protect, i have a html document named test, and the .htpasswrd which contains

    user:2mfVm7JMw2ZB6
    on my home page which is located in pages/home.html i have a link which is to protect/test.html when you click on this link, it takes you to the page without makeing you put in a user name or password.

    1 thing i did notice is that both htaccess, and htpasswrd are .txt files.

    thank you in advance.

    p.s. can you have multiple .htaccesses?
    Last edited by spyder; 08-17-2005 at 12:13 AM. Reason: remembered

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    The .htaccess/.htpasswd files should not have extensions. If you name them .htaccess.txt or .htpasswd.txt, they're not .htaccess and .htpasswd, are they?

    There is no need to have multiple .htaccess files in the same directory; you can put as many instructions as you like in a file.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    May 2005
    Posts
    141
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thanks, i will try that. they became.txt files when i saved automatically. i will try this. thank you very much for the help.

  4. #4
    Join Date
    Feb 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default reg. .txt extension

    Hello,
    I know this is an old post, but I hope someone will see it.
    I have the .txt problem, also. I followed instructions in another post, that explains to go to Tools in a folder, and hide extensions. My folder is set that way, but after I uploaded it shows the .txt in the file.
    I am not sure what to do at this point.
    Any ideas?

    thanks so much for reading this.
    Viki

  5. #5
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    make a new php file and include this code; place it in the folder and run this once, then delete the file:
    PHP Code:
    <?php
    if (file_exists('.htaccess.txt')) { echo rename('.htaccess.txt','.htaccess')?'It worked!':'Something went wrong'; }
    ?>
    Really, though, I recommend finding out how to properly use a file manager (though windows makes this annoying) so you don't have to worry about it.

    Rather than HIDE extensions, you DO want to show them. You may need to manually rename the file after using notepad, but if you show extensions and remove it (after clicking ok on "do you really want to remove this extension" or whatever warning pops up), you should be ok.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •